Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!brunix!drc From: drc@cs.brown.edu (David R. Chase) Newsgroups: comp.lang.c++ Subject: Re: distinguishing stack/heap, garbage collection Message-ID: <32545@brunix.UUCP> Date: 13 Mar 90 08:52:39 GMT References: <9084@shlump.nac.dec.com> <25fc5b7b.4abf@polyslo.CalPoly.EDU> Sender: news@brunix.UUCP Reply-To: drc@cs.brown.edu (David R. Chase) Distribution: usa Organization: Brown University Department of Computer Science Lines: 47 In article <25fc5b7b.4abf@polyslo.CalPoly.EDU> ttwang@polyslo.CalPoly.EDU (Thomas Wang) writes: > >There is such a GC package. It is called MM. Version 1.0 is available ... >Version 2.0 will support exception handling, I hope this isn't a rude question, but is there an easy possibility (with your system) of adding smarts to the compiler to get help in efficient implementation of your GC and exception handling? (That is, does your exception handling follow Tiemann/Cedar/Modula-2+/Modula-3/Ada, or does it follow Stroustrop's proposal (has that been published?)). Static declaration of the exceptions handled, as in (invented syntax) try except { case e1 : ... case e2 : ... case e3 : ... } with the intention that e1, e2, e3 are constants, allows a pretty nifty implementation that imposes no run-time overhead for not taking the exception (except for the optimizations missed, but that's another issue and note that at least the scope in which the optimizer must be throttled is smaller than it would be for setjmp/longjmp). An additional extension (annotation) is to tag procedures (and procedure types) with the exceptions that they may raise. This permits static checking for posible uncaught exceptions, and informs programmers about the possible errors. For garbage collection, of course, I'd hope that the compiler would automatically handle the dirty work for me if I declare that a class has supertype "collectable" ("dirty work" means generating a method to do the collection for me so I don't have to go to any additional trouble). Down the road, of course, the compiler should even figure out when stack storage is adequate for the allocation of one of these objects and do the obvious optimization. Please understand that I'm not asking if it does these things yet -- I just want to know if the hooks exist to permit a streamlined implementation at some time in the future. Just curious -- I'm not exactly in a position to go FTP the bits just yet. (Any garbage collector aficionados care to comment on this package?) David