Python 1.6 The balanced language

Tim Peters tim_one at email.msn.com
Sun Sep 3 18:57:44 EDT 2000


[Aahz]
> Generators are pretty likely to make it into Python through the
> Stackless implementation.  In addition, they're reasonably likely to
> make it in even without Stackless, assuming someone comes up with a
> good implementation -- they'd be incredly useful for generic lazy "for"
> loops.

Guido already knows how to implement generators without Stackless, and
indeed that's (ironically enough!) one of Stackless's problems with getting
into the core:  the one pretty compelling use with broad appeal (iteration a
la CLU and Sather) can be implemented straightforwardly without Stackless.
Generators are also much more usable if a little syntax is added to support
them (like a "suspend" stmt, as in Icon too).

[lobozc at my-deja.com]
> Now, what about goal directed evaluation :-) ?

Sorry, but my bet is no chance at all.  The idea that in, e.g.,

    expr1 + expr2

the language will *always* have the possibility of backtracking into expr1
if expr2 "fails" is foreign not only to the way Python works, but to any
conceivable belief about how Guido *wants* it to work.  It's just too
esoteric.  Having written several large Icon systems in my life too, I'm
afraid I'll have to testify to him that it can be a nightmare to debug, and
also to alter your code 6 months later (let alone somebody else's!).  One of
Griswold's most frequent complaints has been that the Icon Program Library
goes largely unused.  I suspect that's because it's such a chore to figure
out what other peoples' Icon programs *do* <0.7 wink>.

However, if Python sprouts generators, it will also do it Pythonically,
meaning wrapped in objects with the possibility of invoking suspend-like and
resume-like methods explicitly.  Those could be used to build explicit
backtracking by hand, and packaged in your own classes to give Icon-like
overloaded meanings to infix "|" and "&" operators.  Then that becomes your
choice to use explicitly, and doesn't require that all Python programmers
master a large bag of subtle GDE idioms.

python-is-meant-to-be-usable-even-by-idiots-like-me-ly y'rs  - tim






More information about the Python-list mailing list