[pypy-dev] scheme interpreter [status report]

Jakub Gustak jgustak at gmail.com
Thu Aug 9 21:30:41 CEST 2007

Macros looks like working.
One thing to be added: they are acting like first-class objects, but should not.

Right now I am working on continuations.

First a puzzle:
What will return evaluation of s-expression like this:
(call/cc call/cc)
Or what will be bound to k after this s-expression:
(define k (call/cc call/cc))

After some asking on #pypy I decided to create own implementation of
continuations, and not try to use stackless. The reason is that
coroutines are one-shot.

So I created execution stack simulation, or rather stack for
continuation frames.
Right now not every macro uses it, so not every one is continuation-safe.

If macro has defined method continue_tr it should get along with
continuations well.

Another issue: this implementations is stack-only so it introduce lot
of overhead both on capturing and throwing continuations.

And one more: every W_Procedure is continuations-safe but VERY slow,
even when no capture occurs.

I'd rather would like to think about how to throw continuations more
generally, and not have to implement continue_tr for every W_Callable,
than implementing capture differently.

Or maybe try totally different approach e.g write every call in CPS,
but it probably would require way too much changes right now.

Jakub Gustak

More information about the Pypy-dev mailing list