From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Why can't objects be static in Ada? Date: Wed, 17 Apr 2019 00:40:05 +0300 Organization: Tidorum Ltd Message-ID: References: <1127d366-d36c-4abf-8590-4b8c0e2b5446@googlegroups.com> <1beabd13-0c34-4d8a-9a57-45243a07ffc4@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net nc4DFUpA03BfrEqQGxQm3AelbC0rdyCe19wAyWTQ8JvNsQAAku Cancel-Lock: sha1:g7dFOMW+CQU5GNtYkxdGxnRuL4M= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:56144 Date: 2019-04-17T00:40:05+03:00 List-Id: On 19-04-17 00:16 , Lucretia wrote: > On Tuesday, 16 April 2019 22:07:24 UTC+1, Niklas Holsti wrote: > >> Why are you so fixated on elaboration? Many non-Ada libraries >> require initialization calls. Moreover, I believe a C++ program can >> have compiler-generated initialization code similar to Ada >> elaboration code. > > Not everything needs it, the example in this thread shouldn't need > it. So what? Why do you care? >>> I don't think it can, going by this thread. I also think this is >>> why Ada will fail in other environments, i.e. not security or >>> safety critical stuff, but where performance is important. >> >> Performance is plenty important in many embedded real-time >> applications, where Ada works just fine. > > Not every application is embedded, which is my point. You have a problem only for non-embedded applications? Is that why start-up time is important, because your entire applications are frequently started up, run for a short time to do some single thing, and then stop? >> Elaboration of library items consumes execution time only at the >> start of a program. Do you have some stringent start-up deadlines? > > Not exactly, but it would be nice to be able to know that something > which shouldn't need elaboration, doesn't use elaboration. So the thing you want is a "nice to have" feature? And you claim that the lack of that feature means that Ada "will fail"? Not convincing to me. Use the GNAT pragma No_Elaboration_Code, as others have suggested. If you feel strongly about this point, suggest to the ARG that this pragma should be standardized. I have occasionally needed to write packages with guaranteed absence of elaboration code, when operations in those packages are called from the low-level start-up code, to perform some HW initialization before Ada elaboration. No_Elaboration_Code worked for me. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .