stackless python

Christian Tismer tismer at tismer.com
Fri Feb 15 03:27:15 EST 2002


Paul Rubin wrote:

 > Christian Tismer <tismer at tismer.com> writes:
 >
 >>I'm pretty sure Scheme can. It has raw continuations, so you can
 >>implement everything with them, why not microthreads?
 >>Continuations can do even more, they are able to create new
 >>control structures for your language. And exactly that it the point
 >>which makes them insuitable for Python: They are too powerful.
 >>Python has its own control structures, and we don't need a construct
 >>with the power to build some. This is oversized, and very oversized
 >>construct turns out to be a drawback at some future.
 >>What Python needs is a secure mechanism to switch frame changes
 >>at certain times. This is not continuations, but microthreads with
 >>explicit or implicit switching.
 >>
 >
 > The thing I don't fully understand is that several Scheme
 > implementations are both smaller and faster than Python.  I've been
 > wondering for a while whether it's time to graft a Python parser onto
 > a Scheme compiler/evaluator.  The limitations of "simple generators"
 > also seem kind of artificial--maybe Stackless for 2.2 can support
 > calling a generator from multiple places.


Python's approach at generators is the cheapest possible
way to get generators. And this implies that the generator
frame is bound to the current context.
Stackless new dirty little brother goes a completely different
way and can of course generate general generators which do
run without any limitation -- at some cost of course.

Python generators will run at maximum speed, but "stack-based".

Stackless generators will exist as a special case of Stackless
tasklets, which can act as microthreads, coroutines or
generators, at a slightly higher computational cost, but
only limited by the programmer's imagination.

These festures will be available by the end of February 2002,
the latest. A way to pickle program state will be implemented
until end of March 2002.

Kind regards - chris

-- 
Christian Tismer             :^)   <mailto:tismer at tismer.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net/
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
       where do you want to jump today?   http://www.stackless.com/







More information about the Python-list mailing list