Newsgroups: comp.lang.misc,comp.object,comp.lang.scheme,comp.lang.functional,comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!delmarva.com!news-out.internetmci.com!internetMCI!newsfeed.internetmci.com!chi-news.cic.net!simtel!news3.noc.netcom.net!ix.netcom.com!netcom.com!NewsWatcher!user
From: hbaker@netcom.com (Henry Baker)
Subject: Re: (debunk-myth '(debunk-myth '(<-efficient gc malloc/free)))
Message-ID: <hbaker-2810952208350001@10.0.2.15>
Sender: hbaker@netcom16.netcom.com
Organization: nil organization
References: <QOBI.95Oct22061418@qobi.ai> <46dm26$if4@jive.cs.utexas.edu> <QOBI.95Oct22124417@qobi.ai> <DH0GMA.A9w@Cadence.COM>
Date: Sun, 29 Oct 1995 06:08:35 GMT
Lines: 40
Xref: glinda.oz.cs.cmu.edu comp.lang.misc:23570 comp.object:39998 comp.lang.scheme:14177 comp.lang.functional:6607 comp.lang.dylan:5707

In article <DH0GMA.A9w@Cadence.COM>, Simon Kinahan <simonk> wrote:

> qobi@qobi.ai (Jeffrey Mark Siskind) wrote:
> 
> >I've been comming to the conclusion that there are qualitatively three kinds
> >of garbage, at least in the programs that I write:
> >
> >1. *Extremely* short-lived objects that result from using a function style.
> >   Something like the matrix passed between M* and M+ in (M+ (M* A X) Y).
> 
> I agree with you about these. It should be exceptionally easy to spot them
> at compile time, because they usually have not even one reference at
> their own level in the program. What would you recommend though ? I am
> tempted to say that they could be noted somehow as 'one use only'
> and cleaned up when the recieving function (M+ here) returns.

"Linear" types (use-once types) can solve many of these problems easily and
efficiently.  See ftp://ftp.netcom.com/pub/hb/hbaker/Use1Var.html  (also .ps.Z).

> >2. Objects created for use of a particular phase of a program. These objects
> >   predictably become garbage en-masse at very precise points during
execution.

Whether _all_ of these objects become garbage _predictably_ is many times easier
said than done.  The early Lisp compiler on Lisp Machines assumed that all
of the
stuff consed during the first phase of the compiler would become garbage, but
then discovered that things like constants constructed by macros then went
bye-bye during run time (my memory is hazy, but I think that this was one of
the screw cases).

> >3. Objects is a global data base that get asserted and retracted in a
> >   data-dependent fashion as a result of large-time-scale interaction with a
> >   program.

Ditto.

-- 
www/ftp directory:
ftp://ftp.netcom.com/pub/hb/hbaker/home.html
