Re: Compiler writers will love this language

"John R. Strohm" <strohm@airmail.net>
2 Jul 2003 00:39:36 -0400

          From comp.compilers

Related articles
[13 earlier articles]
Re: Compiler writers will love this language d00-mla@nada.kth.se (Mikael 'Zayenz' Lagerkvist) (2003-06-22)
Re: Compiler writers will love this language mwotton@cse.unsw.edu.au (2003-06-22)
Re: Compiler writers will love this language dot@dotat.at (Tony Finch) (2003-06-25)
Re: Compiler writers will love this language lex@cc.gatech.edu (Lex Spoon) (2003-06-25)
Re: Compiler writers will love this language firefly@diku.dk (Peter \Firefly\Lund) (2003-06-25)
Re: Compiler writers will love this language joachim.durchholz@web.de (Joachim Durchholz) (2003-07-02)
Re: Compiler writers will love this language strohm@airmail.net (John R. Strohm) (2003-07-02)
Re: Compiler writers will love this language genew@mail.ocis.net (2003-07-02)
Re: Compiler writers will love this language ericmuttta@email.com (2003-07-02)
Re: Compiler writers will love this language mwotton@cse.unsw.edu.au (2003-07-03)
Re: Compiler writers will love this language nmm1@cus.cam.ac.uk (2003-07-04)
Re: Compiler writers will love this language nmm1@cus.cam.ac.uk (2003-07-04)
Re: Compiler writers will love this language joachim.durchholz@web.de (Joachim Durchholz) (2003-07-13)
[7 later articles]
| List of all articles for this month |

From: "John R. Strohm" <strohm@airmail.net>
Newsgroups: comp.compilers
Date: 2 Jul 2003 00:39:36 -0400
Organization: Compilers Central
References: 03-05-211 03-06-015 03-06-054 03-06-057 03-06-078 03-06-106
Keywords: storage, GC
Posted-Date: 02 Jul 2003 00:39:36 EDT

mwotton@cse.unsw.edu.au (Mark Alexander Wotton) wrote
> On 20 Jun 2003 00:02:55 -0400, Eric posted:
> > mwotton@cse.unsw.edu.au (Mark Alexander Wotton) wrote
> >>
> >> Either that, or only released when all references to it have passed
> >> out of scope. This is how many modern garbage-collected language
> >> implementations work.
> >
> > This scheme (reference-counting) is used in VB6 for instance.
>
> Reference counting and mark-and-sweep are just ways of implementing
> the basic idea of deallocating when references are out of scope.


The problem with reference-counting GC has been known for close to twenty
years that I personally know of. From the well-known "AI Koans":




One day a student came to Moon and said: "I understand how to make a better
garbage collector. We must keep a reference count of the pointers to each
cons."
Moon patiently told the student the following story:




          "One day a student came to Moon and said: `I understand
          how to make a better garbage collector...




[Pure reference-count garbage collectors have problems with circular
structures that point to themselves.]


Note that a doubly-linked list falls into this category...


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.