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!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Running a preprocessor from GPS? Date: Thu, 30 Jul 2015 19:10:22 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <2df4698f-4c8e-457c-822d-209cb2f8ab5e@googlegroups.com> <014427b1-ff7a-4a69-82e6-0330af77ed96@googlegroups.com> <91f88d79-197c-419f-84a8-908e05967a2c@googlegroups.com> <135c2b00-d13c-4f5d-a586-8aca442d363b@googlegroups.com> <2ac21830-619c-4145-ab99-d6036bd4ed30@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1438301423 13617 24.196.82.226 (31 Jul 2015 00:10:23 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 31 Jul 2015 00:10:23 +0000 (UTC) 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.6157 Xref: news.eternal-september.org comp.lang.ada:27249 Date: 2015-07-30T19:10:22-05:00 List-Id: "EGarrulo" wrote in message news:2ac21830-619c-4145-ab99-d6036bd4ed30@googlegroups.com... > On Thursday, July 30, 2015 at 8:56:01 PM UTC+2, Randy Brukardt wrote: >> "EGarrulo" wrote in message >> ... >> > >> >> In Ada, use the stack, if possible! >> >> In Ada 2005, use containers, if possible! >> > >> > Otherwise use C++ and its "shared/weak pointer" support ;) >> >> We had a proposal for adding that to Ada, and it just was a complete >> mess. > > I wonder why. Smart pointers are conceptually simple. Sure, but thats not what the proposal was about. And "weak" pointers aren't so simple; the proposal required converting them (via a function) to a strong pointer before they could be used. And if you put that temporary strong pointer into a handy global, you could end up locking the object for a long time. Plus there was some sort of automated reference counting. We decided instead to follow the Ada philosophy and provide the building blocks so that people could roll their own useful smart pointers. Thus we defined subpools (for arena management of memory), user-defined dereferencing (so that the lifetime of references can be managed), and so on. Perhaps some package will get enough usage that it should be promoted to be part of the Standard (that's what I meant by suggesting that someone propose a package to be added to Ada.Containers), but we didn't think that we had enough of an idea how these things would be used to Standardize it in 2012. > Sure, Ada tries to provide bullet-proof solutions, but that is difficult, > for pointers. Exactly. But what is the point of another half-way safe solution? We already have plenty of those (subpools, unchecked deallocation itself, etc.). Randy.