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:26:15 -0500
Date: 2019-04-16T18:26:15-05:00	[thread overview]
Message-ID: <q95oan$suc$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: ed1629d2-f6d9-4bc9-b929-01f910bfe4a8@googlegroups.com

"Lucretia" <laguest9000@googlemail.com> wrote in message 
news:ed1629d2-f6d9-4bc9-b929-01f910bfe4a8@googlegroups.com...
...
> Not exactly, but it would be nice to be able to know that something
>which shouldn't need elaboration, doesn't use elaboration. That's the 
>point,
>you're missing.

You're confusing the concept of elaboration with execution of explicit 
elaboration code.

Everything in Ada is elaborated at some point. If you look around the 
Standard, you'll see lots of statements like "The elaboration of <blah> has 
no effect.". <blah> is elaborated, but that elaboration does nothing.

And Ada compilers don't generate code to do elaboration unless they have to. 
So you're only talking about a small percentage of code, which is executed 
only once. It's the least likely thing to matter in a program.

In addition, using code rather than some sort of pre-initialization is 
typically smaller and can easily be mapped to ROM and uninitialized RAM in 
an embedded system. For most situations, it's preferable. Worrying about how 
memory is initialized is the height of premature optimization.

                                          Randy.


  parent reply	other threads:[~2019-04-16 23:26 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 [this message]
2019-04-23 14:30           ` Mark Lorenzen
2019-04-16 23:09       ` Randy Brukardt
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