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!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.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: How to get Ada to ?cross the chasm?? Date: Thu, 3 May 2018 18:45:09 -0500 Organization: JSA Research & Innovation Message-ID: References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <87k1su7nag.fsf@nightsong.com> <87po2la2qt.fsf@nightsong.com><87in8buttb.fsf@jacob-sparre.dk> <87wowqpowu.fsf@nightsong.com><16406268-83df-4564-8855-9bd0fe9caac0@googlegroups.com><87o9i2pkcr.fsf@nightsong.com> <87in88m43h.fsf@nightsong.com><87efiuope8.fsf@nightsong.com><322f9b26-01de-4753-bb50-6ef2f3d993d8@googlegroups.com><87a7th9pd1.fsf@nightsong.com><87h8no1nli.fsf@nightsong.com> <874ljo1hvy.fsf@nightsong.com> Injection-Date: Thu, 3 May 2018 23:45:11 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="18043"; 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: reader02.eternal-september.org comp.lang.ada:51958 Date: 2018-05-03T18:45:09-05:00 List-Id: "Paul Rubin" wrote in message news:874ljo1hvy.fsf@nightsong.com... > "Randy Brukardt" writes: >> Surely, and you can use the tree container to represent such a tree. > > Is that something like C++ std::shared_ptr that uses reference counting? > Ok, that would work, but is not too much different from GC, has thread > safety issues, etc. No, it's a tree container. Just like a list container or map container -- it essentially implements a reusable tree structure. How the memory is managed is up to the implementation (other than it must be managed -- not leak.) All of the Ada containers have "cursors", which serve the reference function. You need something like that to specify where to insert something in a tree ("insert_child (tree, parent)" - the parent is represented by a cursor). As with the rest of the container, the implementation of cursors is not part of the standard -- the implementation can make them as safe or unsafe as they want. (Checking for most problems is allowed but not mandated; I would have preferred to mandate checking but lost that discussion.) >> And similarly in the original code, presuming that it is fast >> enough. The compiler does any needed memory managment. > > That program is a huge static data structure embedded in Ada code, so > you have to recompile the whole thing to add a new job title! You call > that systems software?! ;-) Depends on the job, of course. Much of my software indeed works that way, because there is much less security issues with compiled-in settings. (For instance, the web server that runs Ada-Auth.org uses a package of parameters that require a recompilation to change. No attacker can change those parameters, regardless of what bugs occur, since there isn't any runtime object.) That only really works for settings that change very rarely -- but that is the case with most software anyway (once it is installed, it rarely changes again until replaced). Randy.