Subject: Re: Structure of a lisp system. Contd...1
From: rpw3@rpw3.org (Rob Warnock)
Date: Tue, 21 Aug 2007 05:31:02 -0500
Newsgroups: comp.lang.lisp
Message-ID: <d5ednZooeoh7I1fbnZ2dnUVZ_oytnZ2d@speakeasy.net>
Sacha  <none@address.spam> wrote:
+---------------
| CLisp (own byte code) and Armed bear CL (java byte code) are the two CLs 
| compiling to byte code, they indeed have a VM. Other implementations 
| are compiling to native (lispworks, allegro, sbcl, cmucl). These last 4 
| allow for creating standalone executables, I'm not sure about the first 2.
+---------------

Slight correction: CMUCL can *also* compile to byte codes as well as
machine code, and single programs can contain mixtures of functions
that are interpreted (not compiled[1]), byte-compiled, or fully compiled
to machine code. There is automatic conversion of the calling sequences
as necessary.


-Rob

[1] Or rather, only minimally compiled, in the sense of CLHS
    3.2.2.2 "Minimal Compilation". That is, even in CMUCL
    interpreted code, macros are only expanded once, the first
    time the interpreted function is called. [CMUCL internally
    calls this process "conversion".]  For example:

       cmu> (defmacro foo (x)
	      (format *debug-io* "; FOO expanded~%")
	      `(+ ,x 3))

       FOO
       cmu> (defun bar (y)
	      (+ 5 (foo y)))

       BAR
       cmu> (bar 10)
       ; FOO expanded

       18
       cmu> (bar 15)

       23
       cmu> 

Note that no "FOO expanded" message was printed on the
second call to BAR.

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607