Python 2.0 and Stackless

Tim Peters tim_one at email.msn.com
Tue Aug 15 15:55:19 EDT 2000


[posted & mailed]

BTW, note that the Subject line here is out of date:  Python 2.0 went into
feature freeze yesterday, and so there's no longer any chance Stackless will
appear in 2.0.  2.1 is its earliest shot now.

[Cameron Laird]
> Is Christian the one to do it [write a Stackless PEP]?  Maybe his
> time is better spent elsewhere ...

I believe Gordon volunteered.  Heck, I would but am over my eyeballs already
and this needs someone who both can and will follow thru for the long haul.

> I have a strong personal sentiment that someone who brings a gift
> like Stackless shouldn't receive the thanks of another chore to do.

Fortunately, Christian appears to enjoy pain <wink>>

> There are several questions in this area that interest me.
> What *should* a PEP say?  Is it about semantics or implementation?

A PEP is a lightweight version of what *any* standards body requires before
changing the object of their loving ministrations:  what it looks like, what
it does, and why nobody can live without it.  Also why it's not a good idea,
and why the people maintaining that it isn't are terribly misguided, yet
still valued members of the community <wink>.

> My model for the pertinent PEP would be those job ads designed
> to skirt immigration laws:  "This is a PEP for any implementation
> which improves performance, supports microthreads, makes for way
> cool migratable agents, permits easy implementation of a co-routine
> interface, and has been validated in industrial use for at least
> six months."

A PEP isn't a statement of goals or a vague wishlist, though, it's a
hard-sell advertisement for a specific implementation.  Indeed, a "standards
track" PEP *must* be accompanied by a working patch before it can become
"final".  See the informational PEP PEP at

    http://python.sourceforge.net/peps/pep-0001.html

> Do the Stackless fans really care whether it shows up in core
> Python, apart from altruism?

Absolutely!  Else it's a never-ending job of rewriting to patch against the
latest CVS tree.  Over time, that can't be sustained, and CPython may fork
as a result.

> Is there any serious compatibility issue with CPython?  Every
> one I've seen raised, like Mr. Marangozov's complaint that it
> exacerbates the difficulties of calculating state, appears to
> be false.  Stackless shares the extension interface.  It's
> equally pickle-able.  It *simplifies* various introspections.
> Is there a point I've missed?

*Using* the advanced features unique to Stackless will render code
unportable to other Python implementations.  Big deal -- relying on, e.g.,
CPython's refcount semantics does too, and that's a whale of a lot easier to
rely on by accident.

> What *are* the issues for the mass of Python users?

None.

> Will they ever be aware of Stackless apart from its microthreadability
> and not-yet-in-existence co-routine interface?

They don't need to be.  It makes the internals "unusual", though, in ways to
which Guido is not naturally attracted.  That shouldn't be dismissed
lightly!  It's a legitimate concern if the language's primary implementer
can't understand how the core of the implementation works <wink>.

OTOH, *just* getting the C stack out of the picture also provides practical
benefits for everyone, such as giving a robust portable way to catch
"unbounded recursion" (this is a nightmare of guessing how the C stack works
across platforms now, and despite years of fiddling doesn't work reliably on
*any* platform today, except perhaps the Mac), and making Python much more
practical for use on some tiny systems (where the C stack is severely
limited -- Stackless uses heap space instead).

> Gordon and Just, do you agree that most application developers will
> never want to
>   import continuation
> ?

99.99% never will, but please please please leave continuations out of this!
Stackless is a precondition for "import continuation" to work, but they
aren't the same thing.  Stackless makes *lots* of new things possible, and,
of all of those, visible continuations have got to be the most unsellable
idea in the universe.

here's-your-mental-model-turn-it-inside-out-blow-it-into-a-thousand-
    pieces-and-turn-those-inside-out-then-paste-it-all-back-together-
    again-and-suprise!-you-still-don't-get-it<0.5-wink>-ly y'rs  - tim






More information about the Python-list mailing list