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=ham 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!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.net!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: How come Ada isn't more popular? Date: Mon, 12 Feb 2007 09:12:47 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1171264851.456678.83690@m58g2000cwm.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1171289575 22795 192.74.137.71 (12 Feb 2007 14:12:55 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 12 Feb 2007 14:12:55 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:dvvKJQbxMneRnY67hndhvUjVBzU= Xref: g2news2.google.com comp.lang.ada:9284 Date: 2007-02-12T09:12:47-05:00 List-Id: "Harald Korneliussen" writes: > 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 like that quote! Thank you! GC is for managing memory, and it can work well in many situations. It is indeed rather silly to complain that GC is no good because it doesn't manage other resources very well. On the other hand, it is a common occurrence in our industry that somebody invents a good potato peeler, and then wants to throw out every other tool, and use potato peelers for everything. After all, "new" means "improved", right? ;-) Java, Lisp, Smalltalk, etc do this with GC. That is, once we have GC available, we might was well allocate (almost) everything in the heap. That makes GC less efficient (in cases where static or stack allocation would work). It leads to making everything aliased, which causes bugs (except in a pure functional context -- i.e. none of the three languages mentioned above). And it leads to Java's completely broken notion of finalization, which is just asking for race conditions. Anyway, I claim that there is no single memory-management strategy that is suitable in all situations. We have GC (moving, nonmoving, generational, incremental, ...), manual new/free, manual mark/release, reference counting (deferred, nondeferred, ...), region-based (manual, region inference), stack allocation, static allocation, etc. You show me a memory-management strategy, and I can show you a program that will make that strategy look bad. ;-) > I've yet to see an explanation why higher-order wrappers for these > resources don't do the job well enough. I agree -- that technique can work just fine in many cases. It would be a lot more tolerable in Ada if we had anonymous functions (like "lambda" in Lisp). - Bob