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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:5ec2:: with SMTP id h185mr2624341itb.19.1556029849413; Tue, 23 Apr 2019 07:30:49 -0700 (PDT) X-Received: by 2002:a9d:3f4b:: with SMTP id m69mr14421798otc.246.1556029849136; Tue, 23 Apr 2019 07:30:49 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.166.215.MISMATCH!b2no190156itd.0!news-out.google.com!w17ni195itb.0!nntp.google.com!b2no190150itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 23 Apr 2019 07:30:48 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=185.34.132.4; posting-account=Srm5lQoAAAAEMX9rv2ilEKR6FDPapmSq NNTP-Posting-Host: 185.34.132.4 References: <1127d366-d36c-4abf-8590-4b8c0e2b5446@googlegroups.com> <1beabd13-0c34-4d8a-9a57-45243a07ffc4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <95b32abb-8904-4229-8553-d85c68699023@googlegroups.com> Subject: Re: Why can't objects be static in Ada? From: Mark Lorenzen Injection-Date: Tue, 23 Apr 2019 14:30:49 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56179 Date: 2019-04-23T07:30:48-07:00 List-Id: On Tuesday, April 16, 2019 at 11:07:24 PM UTC+2, Niklas Holsti wrote: > On 19-04-16 23:56 , Lucretia wrote: > > On Tuesday, 16 April 2019 13:11:36 UTC+1, Mark Lorenzen wrote: > > > >> How can it be ensured that a library written in Ada does not > >> require any elaboration. Pragma Pure? I think that such libraries > >> are "nice" but pragma Pure is too restrictive for that purpose. In > >> such cases it would be good, if e.g. the OP's problem could be > >> solved at compile time without any elaboration. >=20 > Why are you so fixated on elaboration? Many non-Ada libraries require=20 > initialization calls. Moreover, I believe a C++ program can have=20 > compiler-generated initialization code similar to Ada elaboration code. >=20 > > 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. >=20 > Performance is plenty important in many embedded real-time applications,= =20 > where Ada works just fine. >=20 > Elaboration of library items consumes execution time only at the start=20 > of a program. Do you have some stringent start-up deadlines? >=20 > --=20 > Niklas Holsti > Tidorum Ltd > niklas holsti tidorum fi > . @ . Let's say I'm writing a static library in Ada that is to be used by a progr= am written in C. I can define a C-friendly API and export the API subprograms, but what happ= ens if the library needs elaboration? Using GPRbuild I can define the libra= ry as a "standalone library" such that the binder generates the necessary i= nitialization subprogram that performs elaboration. This is of course tool = specific with the implications that this imposes. Regards, Mark L