comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Why can't objects be static in Ada?
Date: Tue, 16 Apr 2019 18:09:06 -0500
Date: 2019-04-16T18:09:06-05:00	[thread overview]
Message-ID: <q95nai$set$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: 1127d366-d36c-4abf-8590-4b8c0e2b5446@googlegroups.com

"Mark Lorenzen" <mark.lorenzen@gmail.com> wrote in message 
news:1127d366-d36c-4abf-8590-4b8c0e2b5446@googlegroups.com...
...
>How can it be ensured that a library written in Ada does not require any 
>elaboration.

Why would anyone care? You don't try to specify implementation techniques 
for for loops, why do it for elaboration?

Performance isn't likely to be an issue (the elaboration code, if any, only 
runs once). It would take a pretty contrived program to notice the cost. 
(And, in my experience, initializing memory slows down programs if there is 
a lot of memory involved, as all of the memory has to be paged in in that 
case.)

Some programs have outside requirements on the code (such as no heap 
allocation or the like), but those generally go beyond just elaboration and 
there are Restrictions for dealing with them.

Stuff like mapping to ROM or the like is going to be target-dependent in any 
case. And for such mapping, you're better off having less stuff that 
requires writability (as that requires RAM), and more ROM. That's one of the 
reasons that we ignore C.4 (since we had quite a few embedded 80186 
customers back in the day - smaller RAM and ROM requirements are a thing).

So, to me, preelaborate is not solving any problems other than getting rid 
of a few elaboration checks. And GNAT has found a much better way to do 
that. So, in particular, if you are using GNAT, preelaborate buys you little 
other than error messages.

                                                   Randy.



  parent reply	other threads:[~2019-04-16 23:09 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 12:40 Why can't objects be static in Ada? Lucretia
2019-04-11 12:56 ` Mark Lorenzen
2019-04-11 13:31   ` Lucretia
2019-04-11 22:49 ` Randy Brukardt
2019-04-12  1:56   ` Lucretia
2019-04-12  7:33     ` Dmitry A. Kazakov
2019-04-12 22:38     ` Randy Brukardt
2019-04-13  9:14       ` Lucretia
2019-04-12  6:59   ` Mark Lorenzen
2019-04-12  8:12     ` Simon Wright
2019-04-12 22:02     ` Randy Brukardt
2019-04-13 13:07 ` Jere
2019-04-13 13:48   ` Lucretia
2019-04-15 17:46     ` G. B.
2019-04-14  3:47 ` Keith Thompson
2019-04-16  0:08 ` sbelmont700
2019-04-16  1:40   ` Randy Brukardt
2019-04-16 12:11     ` Mark Lorenzen
2019-04-16 16:19       ` Simon Wright
2019-04-16 20:56       ` Lucretia
2019-04-16 21:07         ` Niklas Holsti
2019-04-16 21:16           ` Lucretia
2019-04-16 21:40             ` Niklas Holsti
2019-04-16 23:26             ` Randy Brukardt
2019-04-23 14:30           ` Mark Lorenzen
2019-04-16 23:09       ` Randy Brukardt [this message]
2019-04-22 20:05       ` Norman Worth
2019-04-16 20:54     ` Lucretia
2019-04-16 23:15       ` Randy Brukardt
2019-04-16 20:53   ` Lucretia
2019-04-18 13:32 ` sbelmont700
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox