home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.object:3318 comp.lang.clos:727
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!sdd.hp.com!uakari.primate.wisc.edu!ames!ads.com!saturn!doug
- From: doug@monet.ads.com (Doug Morgan)
- Newsgroups: comp.object,comp.lang.clos
- Subject: Re: Beginner's Question - CLOS
- Message-ID: <DOUG.92Aug25095415@monet.ads.com>
- Date: 25 Aug 92 17:54:15 GMT
- References: <16u2tpINN9ad@early-bird.think.com>
- <1992Aug19.213818.21709@tfs.com>
- <DCMARTIN.92Aug19151550@fascet.msi.com>
- <170fu1INNmfh@early-bird.think.com>
- <PCG.92Aug21005641@aberdb.aber.ac.uk>
- <DAVIS.92Aug24110309@reaumur.ilog.fr> <DOUG.92Aug24104842@monet.ads
- Sender: usenet@ads.com (USENET News)
- Organization: Advanced Decision Systems, Mountain View, CA 94043, +1 (415)
- 960-7300
- Lines: 40
- In-Reply-To: davis@reaumur.ilog.fr's message of 25 Aug 92 08:32:47 GMT
-
- In article <DAVIS.92Aug25103247@reaumur.ilog.fr> davis@reaumur.ilog.fr (Harley Davis) writes:
-
- The interesting optimization that was originally mentioned was
- *statically* resolving generic function calls, not optimizing dynamic
- dispatch. To do this, you have to guarantee that the class hierarchy
- is fixed and that all the methods attached to the generic function are
- known. Then, in some cases, you could resolve dispatch at
- compile-time. I suspect that most implementations already do a fairly
- good job of optimizing dynamic dispatch in the ways you mention.
-
- I never mentioned "dynamic dispatch." I said "I suspect the CL spec,
- as is, allows for an automatic system building tool with dispatch
- optimizations that are based on the entire type graph and are capable
- of being *dynamically* maintained in the face of class graph changes."
- ("Dynamic" never modified dispatch. Rather, "dynamically" applied to
- the *maintenance* of whatever collection of dispatch mechanisms you
- use.) The dispatch optimization with the biggest bang is precisely
- statically resolving generic function calls (especially to the point
- of inlining small methods) and that is precisely what I was trying to
- say that the CL spec allows. I was, for instance, arguing that CL
- supports compiling static resolution of dispatch at one time, noticing
- that the class graph later changes, and then recompiling the user code
- that previously compiled into static dispatch to now do dynamic
- dispatch. Another possible dispatch optimization (dynamic this time)
- would be to generate method dispatch tables (shades of C++) for
- generic functions that currently only effectively specialize on one
- argument.
-
- I do agree that this would only make CL bigger, more complicated, and
- even subject to more strange run-time behaviors. It goes against your
- reasonable desire for "small" lisps. However, some people might go
- for the possibility of truly blazing speed combined with the full
- run-time flexibility of standard CL/CLOS.
-
- doug
- --------------------------------------------------------------------
- Doug Morgan, doug@ads.com, (415) 960-7300
- Advanced Decision Systems (a division of Booz-Allen & Hamilton Inc.)
- 1500 Plymouth St., Mountain View, CA 94043-1230
- --------------------------------------------------------------------
-