On Sep 16, 2007, at 8:13 PM, Christian Tismer wrote:
Erik Gorset wrote:I'm wondering if there is any plans for pypy/stackless to supporttrue continuations as first class citizen in the future? It would be easyto implement coroutines and exceptions in normal python code if call/cc was supported. After all, ruby, scheme and smalltalk can support this :-)Maybe this is possible, but that's not a reason to do it. I have spent a little too much of my lifetime with taming continuations. And since Python has all the control flow it needs, it does not make sense to add continuations, which impose extra complications for no gain. I think to stick with coroutines as the building block, unless there is a real need for continuations.
Actually, having continuations as a fundamental building block is a big simplification as all other control flows can be expressed by it. The only "flaw" is that you can't use the c stack in a normal way since the executing contexts will form a tree instead of a linear structure. Of course, we can argue that this isn't pythonic anymore, so I believe I see your point. I'm already using greenlet extension for cpython heavily in my code, which is just GREAT :-) So I can live happily in python without continuations as long as I have coroutines. Btw, it's possible to simulate some of call/cc's behavior using _stackless.fork() (I have a play-implementation lying around here somewhere). But it has several issues. The biggest one is that fork() actually copies some of the objects found on the stack. It's been a while since I've played around with cloneable and fork, so maybe this has been fixed. -- Erik Gorset
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ [email protected] http://codespeak.net/mailman/listinfo/pypy-dev
