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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,21960280f1d61e84 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!m58g2000cwm.googlegroups.com!not-for-mail From: "Harald Korneliussen" Newsgroups: comp.lang.ada Subject: Re: How come Ada isn't more popular? Date: 11 Feb 2007 23:20:51 -0800 Organization: http://groups.google.com Message-ID: <1171264851.456678.83690@m58g2000cwm.googlegroups.com> References: NNTP-Posting-Host: 213.184.192.82 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1171264856 8124 127.0.0.1 (12 Feb 2007 07:20:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 12 Feb 2007 07:20:56 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; nb-NO; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: m58g2000cwm.googlegroups.com; posting-host=213.184.192.82; posting-account=5vUApw0AAADF5Kx_4-L9ZPdL9lZywYoQ Xref: g2news2.google.com comp.lang.ada:9271 Date: 2007-02-11T23:20:51-08:00 List-Id: On 9 Feb, 20:52, Ray Blaak wrote: > "Randy Brukardt" writes: > What I refer to as manual management is for heap values, such that that for > every "new" one must remember eventually to call "deallocate". > And I think it should be an easy choice that _if_ you need such values at all (never mind that the ati-GC folks claim that they hardly ever need them, or that they are design faults - as if design not structured around memory management was somehow sinful), then they should be garbage collected. Relying on Unchecked_deallocation is against the spirit of Ada, as it (re)introduces almost all the manual memory management issues that make C/C++ such a pain. As for the complaints that garbage collectors aren't general purpose enough, I'm reminded of Babbage's (allegorical) lament when the British government cut funding for the analytical engine: "Propose to an Englishman any principle, or any instrument, however admirable, and you will observe that the whole effort of the English mind is directed to find a difficulty, a defect, or an impossibility in it. If you speak to him of a machine for peeling a potato, he will pronounce it impossible: if you peel a potato with it before his eyes, he will declare it useless, because it will not slice a pineapple." I've yet to see an explanation why higher-order wrappers for these resources don't do the job well enough. You write a function F that takes a filename and a function argument telling what to do with it. F then opens the file, does its thing, and closes the file. In scheme this is readily avaliable as the call-with-input-file / call-with- output-file, in Haskell it's trivially done with the more general bracket function.