[Shootout-list] Missing programs and score calculation (Was:

Stephen Weeks sweeks at sweeks.com
Sun Sep 18 21:08:26 UTC 2005


> I am not surprised Ocaml has a low level intermediate language
> representation lacking lambdas: Felix does too. Perhaps one
> difference is that many FPL's seem to do lambda-lifting late,
> whereas Felix lifts them out immediately after parsing.
...
> Lifting lambdas early allows the compiler
> to concentrate on optimisations such as closure removal,
> control flow, inlining, etc, more commonly associated
> with procedural languages

You may be interested to know that MLton also does lambda lifting
early, and I believe it is a significant contributor to MLton's
effectiveness.

> For example: Felix follows the tradition of 
> C/C++/Algol/Pascal/Modula in maintaining whole stack frames
> in which variables are located, whereas Ocaml (and I think
> MLton and Haskell and most FPLS) maintain variables
> independently as boxed heap values. 

Regarding MLton this is not correct.  MLton uses traditional stack
frames; that is, the frames are mutable, variable values are stored
directly in the frames, and (nontail) procedure call pushes a frame on
the stack by bumping a stack pointer.  As to boxing, MLton uses
momonorphisation to avoid much of the boxing one would find in a
traditional polymorphic-language implementation.

> On the other hand whole frames are cheap to manage,
> but they cost more storage than individual variable management,
> and failure to eliminiate dead pointers means the collector
> has more work to do sweeping the heap.

This need not be a problem.  For example, MLton is quite careful to
preserve variable lifetimes and make the liveness information
available to the runtime.



More information about the Shootout-list mailing list