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.2 required=5.0 tests=BAYES_00,FROM_WORDY, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,184737148aef02ac X-Google-Attributes: gid103376,public From: "Nick Roberts" Subject: Re: GC+HC for GNAT/GCC (was: Building a compiler) Date: 1999/02/05 Message-ID: <79enud$lvc$2@plug.news.pipex.net>#1/1 X-Deja-AN: 440966562 References: <78sojm$crk$1@plug.news.pipex.net> <7982p7$nll$1@plug.news.pipex.net> <87aeyv4kbg.fsf@mihalis.ix.netcom.com> <79asc3$cq3$1@nnrp1.dejanews.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: UUNET WorldCom server (post doesn't reflect views of UUNET WorldCom) Newsgroups: comp.lang.ada Date: 1999-02-05T00:00:00+00:00 List-Id: robert_dewar@my-dejanews.com wrote in message <79asc3$cq3$1@nnrp1.dejanews.com>... |A very nice project would be to try to add full garbage |collection to GNAT .... Now _there's_ a challenge! Actually, I'd be really surprised if someone hasn't already done this. Still, I'm quite happy to throw in a contribution if it would be genuinely useful. First, let's be clear about what we are talking about. By "full garbage collection", I assume Robert means both 'garbage collection' (i.e. recognising which allocated objects are no longer accessible), and 'heap compaction' (i.e. moving allocated objects so as to remove unused fragments from their pool). There are several possible combinations of schemes, all with their own peculiar merits and problems, so I would suggest that a wide selection be provided (as different pool types). It should be understood that all of these schemes would have various ramifications for both the GNAT front-end intermediate code emitter, as well as for the GCC back-end object code emitter. Locking variations would require a special machine instruction (different for each target architecture). It would probably be sensible for someone familiar with GNAT and GCC to help me to 'splice' my code into GNAT and GCC. Any volunteers? Finally, a quote: "Machines with so-called 'virtual storage' may give the compiler writer a large number of logically separate segments of storage, all of which can be of effectively boundless size. The catch is that if storage is used as if it were boundless, the time taken to run programs will be equally boundless. Thus, irrespective of whether virtual storage is available, you do well to be miserly with your storage." -- P.J.Brown, "Writing Interactive Compilers and Interpreters", Wiley 1979 [written in the days of MULTICS: for "number of logically separate segments" substitute "linear address space"] And another: "Garbage collection is a feature of the run-time support for some imperative languages (such as Ada) ..." -- David A. Watt "Programming Language Processors", Prentice Hall 1993 In practice, full GC isn't a feature of Ada - but I reckon it should be (at least as an option). So, like Captain Picard, let's "make it so"! Nick Roberts