Dan Sugalski <[EMAIL PROTECTED]> wrote:
> Okay, I've looked over Leo's proposal. I'm not comfortable with some
> of what it does, so I think it's no-go, ...

What does it make a "no-go"?

> 1) The interpreter pointer gets another level of indirection, it
> points to a pointer to the interpreter. (We'll see why in a bit) I
> loathe this one, it burns about 3-4% performance right off the bat,
> but there's nothing for it. Dammit.

This indirection would be in the run-loops only?

> 2) We realize that there *is* no return statement, there is only the
> invocation of continuations. This is important.

> 3) Subs, methods, coroutines, continuations, and closures are all
> continuations. This is also important.

> 4) Each continuation has a *template* interpreter structure attached
> to it. For return continuations the template is the current
> interpreter structure.

These all seems to match my proposal pretty fine.

> 5) When a continuation is invoked, a *new* interpreter structure is
> allocated and the contents of the template are copied into it.

When calling a sub. When returning you have the "template" already. Or
am I misunderstanding this? Is this copying done on each subroutine
call or even return?

> ... The
> interpreter handle is changed to point to the new interpreter
> structure. The destination interpreter has its top register half left
> alone, while the bottom half is copied from the current interpreter.

Brr, sorry. Why do you want to copy 320 bytes (32-bit system) *always*.
Especially on function returns, where its really likely that you have
exactly one PMC to copy?

Could you please explain the differences to my scheme at best with some
code snippets for call and return.

leo

Reply via email to