Subject: Re: What is the best Open-Source Lisp?
From: rpw3@rpw3.org (Rob Warnock)
Date: Wed, 22 Feb 2006 03:00:15 -0600
Newsgroups: comp.lang.lisp
Message-ID: <OOKdnavWbayCtWHeRVn-tg@speakeasy.net>
Edmond Dantes  <edmond@@le-comte-de-monte-cristo.biz> wrote:
+---------------
| I take it that CMUCL and SBCL can compile Lisp as well?
| And is the compilation to native or intermediate "bytecode"?
+---------------

    cmu> (cons (lisp-implementation-type) (lisp-implementation-version))

    ("CMU Common Lisp" . "19a")
    cmu> (machine-type)

    "X86"
    cmu> (defun foo (a b c)
	   (declare (optimize (speed 3) (safety 0) (debug 0))
		    (fixnum a b c))
	   (the fixnum (* (the fixnum (+ a b)) c)))

    FOO
    cmu> (compile 'foo)
    ; Compiling LAMBDA (A B): 
    ; Compiling Top-Level Form: 

    FOO
    NIL
    NIL
    cmu> (disassemble 'foo)
    58972CA8:       .ENTRY FOO()                 ; FUNCTION
	  C0:       POP     DWORD PTR [EBP-8]
	  C3:       LEA     ESP, [EBP-32]
	  C6:       ADD     EDX, EDI             ; No-arg-parsing entry point
	  C8:       SAR     EDX, 2
	  CB:       IMUL    EDX, ESI
	  CE:       MOV     ECX, [EBP-8]
	  D1:       MOV     EAX, [EBP-4]
	  D4:       ADD     ECX, 2
	  D7:       MOV     ESP, EBP
	  D9:       MOV     EBP, EAX
	  DB:       JMP     ECX
	  DD:       NOP
	  DE:       NOP
	  DF:       NOP
    cmu> 


-Rob

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