Hallo,
On 5/23/09, Marc Feeley feeley@iro.umontreal.ca wrote:
In the context of a full implementation of Scheme (with first class continuations), the use of CPS as an intermediate representation:
- Simplifies writing a simple non-optimizing compiler (see the 90 minutes
Scheme compiler). Why? Because first-class continuations come "for free".
- Make it more difficult (but not impossible) to write an optimizing
compiler. Why? Because an advanced static analysis is needed to determine which closures can be managed in a "stack like" manner.
Thanks for the thorough explanation, Marc. Would you say that the harder to implement advanced static analysis required would pay off in the end, generally speaking? Well, this is kind of off-topic, but I'm playing with a toy scheme compiler based on LiSP and Dybvig's PhD, so I am curious. If this is unacceptable, let me know.
Cheers,