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!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Why can't objects be static in Ada? Date: Tue, 16 Apr 2019 18:09:06 -0500 Organization: JSA Research & Innovation Message-ID: References: <1127d366-d36c-4abf-8590-4b8c0e2b5446@googlegroups.com> Injection-Date: Tue, 16 Apr 2019 23:09:06 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="29149"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader01.eternal-september.org comp.lang.ada:56145 Date: 2019-04-16T18:09:06-05:00 List-Id: "Mark Lorenzen" 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.