Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!news2.near.net!MathWorks.Com!news.duke.edu!news-feed-1.peachnet.edu!gatech!swrinde!cs.utexas.edu!uunet!EU.net!julienas!news.fnet.fr!ilog!news
From: davis@ilog.fr (Harley Davis)
Subject: Re: C is faster than lisp (lisp vs c++ / Rick Graham...)
In-Reply-To: jeff@aiai.ed.ac.uk's message of Fri, 26 Aug 1994 15:02:46 GMT
Message-ID: <DAVIS.94Sep1110221@passy.ilog.fr>
Lines: 41
Sender: news@ilog.fr
Nntp-Posting-Host: passy
Organization: Ilog SA, Gentilly, France
References: <CuzxyG.6v2@triple-i.com> <33dijm$egq@pulitzer.eng.sematech.org>
	<TMB.94Aug24222912@arolla.idiap.ch> <Cv5DsM.9q8@cogsci.ed.ac.uk>
Date: 01 Sep 1994 09:02:20 GMT


In article <Cv5DsM.9q8@cogsci.ed.ac.uk> jeff@aiai.ed.ac.uk (Jeff Dalton) writes:

   >I think the problem with the presence of GC in CL is more subtle: CL
   >implementors rely on it "because it's there".  So, in one of those
   >run-of-the-mill CL implementations, you can't escape garbage
   >collection, even if you meticulously avoid consing in your own code,
   >because simple standard functions or even compiled code that has no
   >business even allocating heap memory will generate garbage.  And the
   >programmer can't even control it.  He is lucky if he even can figure
   >out where and why it is happening.

   Well, there used to be a view that the implementation shouldn't
   allocate unless the user's code did something that required
   allocation.  It sounds like we've moved backwards since the 70s!

Good Lisp implementations will document the allocation behavior of
library functions.  (Well, ours does anyway.)

However, sometimes unexpected allocations might occur: For example, I
think all major generic-function based object system implementations
use method caches, and the first time you call a generic function it
might allocate the cache, or it might allocate effective methods, and
so on.  If this allocation didn't occur, you would either have very
slow generic function calls or massive pre-allocation leading to large
memory images.  (This behavior should also be documented for a given
implementation so it isn't completely unexpected.  You can also manage
this sort of storage manually to avoid any chance of a GC but I'm not
sure if any implementations actually do this.) As far as I know, the
method caching technology is post-70's.

-- Harley Davis
-- 

------------------------------------------------------------------------------
motto: Use an integrated object-oriented dynamic language today.
       Write to info@ilog.com and ask about Ilog Talk.
------------------------------------------------------------------------------
nom: Harley Davis			ILOG S.A.
net: davis@ilog.fr			2 Avenue Gallini, BP 85
tel: +33 1 46 63 66 66			94253 Gentilly Cedex, France
