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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd63afa4dc364b7e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-16 13:52:16 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!falcon.america.net!sunqbc.risq.qc.ca!xmission!logbridge.uoregon.edu!newsfeed.mesh.ad.jp!sjc-peer.news.verio.net!news.verio.net!sea-read.news.verio.net.POSTED!not-for-mail Newsgroups: comp.lang.ada From: Brian Rogoff Subject: Re: Better support for garbage collection In-Reply-To: Message-ID: References: <98m938$2iod0$1@ID-25716.news.dfncis.de> <98pgs1$32up7$1@ID-25716.news.dfncis.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Fri, 16 Mar 2001 18:29:23 GMT NNTP-Posting-Host: 206.184.139.136 X-Complaints-To: abuse@verio.net X-Trace: sea-read.news.verio.net 984767363 206.184.139.136 (Fri, 16 Mar 2001 18:29:23 GMT) NNTP-Posting-Date: Fri, 16 Mar 2001 18:29:23 GMT Organization: Verio Xref: supernews.google.com comp.lang.ada:5767 Date: 2001-03-16T18:29:23+00:00 List-Id: On Fri, 16 Mar 2001, Robert A Duff wrote: > Brian Rogoff writes: > > > The cynic may counter that one doesn't see a lot of demand for Ada either. > > Of course that says nothing about GC. > > If my company had money to burn, I would implement GC, and see if it > attracts more people to Ada. But I wouldn't bet my own money on that. ;-) I wouldn't bet my time or money on this either. I agree with your last statement that modifying GNAT is the way to go. This is probably a good university project. > > I think there will never be a single approach which will work well for all > > cases. > > I strongly agree. > > In fact, I think part of the reason GC didn't catch on for many years > (Java is really the first popular GC'ed language) is the overblown > claims of some GC zealots. Well, I doubt those claims had much to do with the success of GC one way or the other. I think it's only relatively recently that huge numbers of programmers are working in "scripting" languages most of the time, and scripting languages generally don't have manual memory management. > >... Even amongst "GC-ed" language advocates, you can see that there is > > some realization that for embedded or hard real-time problems you may need > > other approaches. I'm thinking of the ML-Kit and it's region based memory > > manager, http://www.it-c.dk/research/mlkit/kit3/readme.html > > I've read various papers that claim to describe "real time" garbage > collection, only to be disappointed to find that its not so "hard" real > time after all (and have intolerable overheads for some programs). Oh, I think you are actually already familiar with region based memory management. It's really just a variation of "arenas" where you don't have to match frees to allocs; you alloc from a region and free the entire region in one call (like the pool in the Ada Rationale). So it's not like the pointer chasing algorithms I associate with real GC. > > Still, I program in a GCed language now and I have to admit that my > > "programming velocity" is better than it was with Ada (yeah, I know, who > > cares, readability, blah, blah, blah :) and even if GC isn't the main > > reason it certainly helps. > > Which language? OCaml (caml.inria.fr if you're interested), which I admit is hardly popular. Yes, I've used Java at two jobs since it came out and I don't think it holds a candle to Ada *as a language*. OCaml has static typing, a good module system, and a great implementation. I'd think that Ada programmers should at least consider it as a scripting tool. Performance-wise it is impressive. > > > Memory leaks are indeed annoying. GC can help a lot. But it doesn't > > > completely cure the problem -- you still have to use your brain when > > > writing programs. I've seen memory leaks in GC'ed programs. > > > > Static typing doesn't cure bugs either. > > Right, but there are fewer zealots making *that* claim. I guess you don't read comp.lang.functional. :-) Anyways, I don't know any GC zealots. Most programmers think GC leads to bloated slow programs, and while they were talking out their hats a few years ago now they have Java as proof. > > My worry about GC in Ada would be that the bugs caused by the interaction > > of GC and unsafe features would be difficult. > > I think I've heard Robert Dewar express that attitude (ie, perhaps GC is > inappropriate in a language that also has unsafe features). Modula-3 is kind of the dual of a GC-ed Ada: GC is the default but it supports an unsafe features in specially marked modules. -- Brian