[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some questions

>> Do you transform the source to continuation passing style before
>> compiling?  
>> How happy are you with this decision?  
>> If you don't, do you do tail-recursion optimizations anyway?

    The Franz Inc. ExCL (Extended Common Lisp) compiler does not
transform to a continuation passing style before compilation.  It
detects tail-recursive calls and eliminates some self-tail-recursive
calls and will soon give the user the option of eliminating non-self
tail-recursive calls on certain architectures.
    Since Rob gave a description of some other compilers, I'll briefly
describe ours:  It was written from scratch for Common Lisp (it is
*not* based on either the Spice Lisp compiler or the Franz Lisp
compiler).  It has four passes, the first being completely machine
independent and the last completely machine dependent, with the middle
passes being somewhere in between (i.e. machine independent skeletons
with machine dependent flesh).   Optimizations are done in each pass.
One feature of the ExCL compiler that distinguishes it from other
'stock hardware' compilers is that by default it generates code which
is as safe as interpreted code (with very low overhead).  You can make it 
unsafe (to various degrees) by adding type declarations and/or using 
the optimization declaration, and this indeed helps in very frequently 
executed code, but in most code the speed difference between being safe 
and unsafe is imperceptible, and the benefits of being safe are tremendous.

-john foderaro, franz inc.