On Tue, 20 Jul 2004 00:00:22 +0900, Mikael Brockman wrote:

Hi,

> Kristof Bastiaensen <kristof / vleeuwen.org> writes:
> 
>> Well, I do think it is possible to compile Ruby, but it would be to hard.
>> Firstly eval and module_eval should be thrown away, because they need to
>> be able to parse code at runtime.
>> Continuations make compiling very messy, since the stack needs to be
>> copied.
> 
> That's not strictly true.  If you convert the code to
> continuation-passing style, reifying continuations doesn't require
> copying the stack.  CHICKEN and many other Scheme compilers choose this
> approach.
> 
>   mikael

That's interesting.  Could you explain how that works?
My idea was that when a continuation is saved, it needs
to keep the information, where it is going to (return
adresses), and all local bindings.  I would think the best
way is to save the stack, at least for compiled (machine)
code.

Kristof