Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Kleeneness is next to Godelness.


devel / comp.lang.ada / Re: Constancy of X'Address?

SubjectAuthor
* Constancy of X'Address?Niklas Holsti
+- Re: Constancy of X'Address?Maxim Reznik
+- Re: Constancy of X'Address?Jeffrey R.Carter
`- Re: Constancy of X'Address?Randy Brukardt

1
Constancy of X'Address?

<k94t2nFelgbU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9475&group=comp.lang.ada#9475

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.holsti@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.lang.ada
Subject: Constancy of X'Address?
Date: Wed, 5 Apr 2023 12:24:39 +0300
Organization: Tidorum Ltd
Lines: 13
Message-ID: <k94t2nFelgbU1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net juDKVaBYK50YlczI6SaMHQeKit8sKDr5/XWq9+txS5IGT923Oo
Cancel-Lock: sha1:9BjAnEvFBfxzAKv0hYKrLm8Ga34=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0)
Gecko/20100101 Thunderbird/102.6.1
Content-Language: en-US
 by: Niklas Holsti - Wed, 5 Apr 2023 09:24 UTC

A discussion in comp.arch (on the new C23 standard for C) brought up
these questions, which I could not answer with confidence:

- Is the address of an object constant in Ada? That is, if I have some
object X in an Ada program, do repeated applications of X'Address always
return the same value?

- Does the answer depend on how X is allocated (created): on the library
level, on the stack, or in a pool ("new")?

The issue behind this question is whether an Ada program could use
garbage collection that moves objects around, for example a compacting
collector.

Re: Constancy of X'Address?

<56cac028-1a5e-4889-bc84-fa9025ed375en@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9479&group=comp.lang.ada#9479

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:5905:0:b0:3d9:650a:7a9f with SMTP id 5-20020ac85905000000b003d9650a7a9fmr1023508qty.3.1680887064511;
Fri, 07 Apr 2023 10:04:24 -0700 (PDT)
X-Received: by 2002:a25:dfd2:0:b0:b8e:c9f3:7e23 with SMTP id
w201-20020a25dfd2000000b00b8ec9f37e23mr415301ybg.2.1680887064241; Fri, 07 Apr
2023 10:04:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Fri, 7 Apr 2023 10:04:24 -0700 (PDT)
In-Reply-To: <k94t2nFelgbU1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=2a03:7380:380d:1fb:fb3e:cc36:708d:f0b1;
posting-account=K1cP1QoAAAD_GR6kW2Td0NqGqGBLRE8h
NNTP-Posting-Host: 2a03:7380:380d:1fb:fb3e:cc36:708d:f0b1
References: <k94t2nFelgbU1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <56cac028-1a5e-4889-bc84-fa9025ed375en@googlegroups.com>
Subject: Re: Constancy of X'Address?
From: reznikmm@gmail.com (Maxim Reznik)
Injection-Date: Fri, 07 Apr 2023 17:04:24 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1246
 by: Maxim Reznik - Fri, 7 Apr 2023 17:04 UTC

If the type of the object is limited, then the object address is a constant. For other objects there is no such guaranty I guess.

Re: Constancy of X'Address?

<u0pjai$rl60$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9480&group=comp.lang.ada#9480

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: spam.jrcarter.not@spam.acm.org.not (Jeffrey R.Carter)
Newsgroups: comp.lang.ada
Subject: Re: Constancy of X'Address?
Date: Fri, 7 Apr 2023 19:19:14 +0200
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <u0pjai$rl60$1@dont-email.me>
References: <k94t2nFelgbU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 7 Apr 2023 17:19:14 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f74ee5803648d83e8f93680e4ea9472e";
logging-data="906432"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18XiqckiuLqsDRIdeYzl2vllKpLRpvBR0M="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:BX6A65bUc3t5VzcVbTGQbAwq8/0=
In-Reply-To: <k94t2nFelgbU1@mid.individual.net>
Content-Language: en-US
 by: Jeffrey R.Carter - Fri, 7 Apr 2023 17:19 UTC

On 2023-04-05 11:24, Niklas Holsti wrote:
>
> - Is the address of an object constant in Ada? That is, if I have some object X
> in an Ada program, do repeated applications of X'Address always return the same
> value?
>
> - Does the answer depend on how X is allocated (created): on the library level,
> on the stack, or in a pool ("new")?

'Address is discussed in ARM 13.3
(http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-13-3.html). (12.c) says
"The validity of a given address depends on the run-time model; thus, in order
to use Address clauses correctly, one needs intimate knowledge of the run-time
model."

Under Implementation Advice, (15-16) say "The recommended level of support for
the Address attribute is:

"X'Address should produce a useful result if X is an object that is aliased or
of a by-reference type, or is an entity whose Address has been specified."

There is nothing specific about whether the value can change.

--
Jeff Carter
"We'll make Rock Ridge think it's a chicken
that got caught in a tractor's nuts!"
Blazing Saddles
87

Re: Constancy of X'Address?

<u0rak8$1768a$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9483&group=comp.lang.ada#9483

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: Constancy of X'Address?
Date: Sat, 8 Apr 2023 04:03:02 -0500
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <u0rak8$1768a$1@dont-email.me>
References: <k94t2nFelgbU1@mid.individual.net>
Injection-Date: Sat, 8 Apr 2023 09:03:04 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8cffde185656e4854c99d85efea8bf85";
logging-data="1284362"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eMNoROdhku48SorYNIWcddfpM21ILe0c="
Cancel-Lock: sha1:Pw3yXvAYpP9AuF+NisZ92e+8kvc=
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-Priority: 3
 by: Randy Brukardt - Sat, 8 Apr 2023 09:03 UTC

I agree with the other answers (for the most part). Not much is guarenteed
about 'Address. But by-reference and aliased objects have to *work* like
they are not moved. If the runtime can deal with moving such things, Ada
doesn't care.

As a practical matter, most Ada implementations assume objects don't move.
Janus/Ada assigns everything at compile-time, so the only time anything
moves is when it is created or destroyed.

The big problem with garbage collection in Ada is that early finalization is
not allowed (other than a few tiny exceptions in failure cases and [in
post-Ada 22] certain function results.) So any object that might have a
controlled part can never be garbage collected, even if there is no other
use or access to it.

Changing that is a very hard problem, as you cannot allow finalization to
happen at any instant or by any arbitrary task (if you did, every
finalization would be a race scenario, and every Finalize routine would need
dedicated locking). I've suggesting allowing it for "unreachable objects"
(not a useful definition by itself, it would need to be defined) at places
where masters are being exited anyway (so finalization should be expected at
those locations). But it's unclear if you can build a useful garbage
collector that way (and what the overhead would be).

Randy.

"Niklas Holsti" <niklas.holsti@tidorum.invalid> wrote in message
news:k94t2nFelgbU1@mid.individual.net...
>A discussion in comp.arch (on the new C23 standard for C) brought up these
>questions, which I could not answer with confidence:
>
> - Is the address of an object constant in Ada? That is, if I have some
> object X in an Ada program, do repeated applications of X'Address always
> return the same value?
>
> - Does the answer depend on how X is allocated (created): on the library
> level, on the stack, or in a pool ("new")?
>
> The issue behind this question is whether an Ada program could use garbage
> collection that moves objects around, for example a compacting collector.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor