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!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Thu, 03 May 2018 15:41:53 -0700 Organization: A noiseless patient Spider Message-ID: <874ljo1hvy.fsf@nightsong.com> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="9aa481526158253a2df1c34e89df6734"; logging-data="16249"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+KYyXhU70wjIeiNv6557AF" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:2edP6O8wsrh7ZMUuQeNILmd8KpE= sha1:hVBga+46FMIjxjAMJmTwEkoheZA= Xref: reader02.eternal-september.org comp.lang.ada:51956 Date: 2018-05-03T15:41:53-07:00 List-Id: "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. > 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?! ;-) > The cost of doing that is rarely an issue (see the many threads here > on premature optimization). The cost of GC is rarely an issue either, so resisting using it is also a premature optimization, of course ;). I do find in C++ the alternative to GC is often copying data around all over the place, which is what that program does. That can get expensive. If Alice is deep enough in the bureaucracy, her job title might be a megabyte long. And if it's copied into the job titles of her 1000s of direct and indirect assistants, that's GB's of memory right there instead of a few KB of pointers.