Python 2.0 and Stackless

Toby Dickenson mbel44 at dial.pipex.net
Mon Aug 7 06:11:10 EDT 2000


"Jeff Petkau" <jpet at eskimo.com> wrote:

>Here's one way to look at it:
>
>For normal Python programs (that don't use stackless or uthreads),
>the *only* effect of the stackless patch is to make Python faster
>and more crash-resistant (since you can't overflow the C stack).
>So it's a complete win, no downside.
>
>For programs that want to use stackless or uthreads, it allows
>you to do things that you just *can't do* otherwise. Uthreads is
>amazingly wonderful for simulations, or as a plug-in scripting
>language for games. So it's still a complete win.

That dicotomy isnt quite the whole truth.

In a post-stackless interpreter all library code has to be aware of
the implications of stacklessness, unless it can be sure that it will
never be used in a stackless program.

Consider this "naive" function

def m(y):
   x()
   try:
      y()
   finally:
      z()

Today I can be sure that a call to z is always preceeded by a single
call to x. Stacklessness makes that assumption false.



Toby Dickenson
tdickenson at geminidataloggers.com



More information about the Python-list mailing list