[Python-Dev] Cool link

Tim Peters tim.one@home.com
Sun, 11 Feb 2001 19:08:37 -0500


Mentioned on c.l.py:

    http://cseng.aw.com/book/related/0,3833,0805311912+20,00.html

This is the full text of "Advanced Programming Language Design", available
online a chapter at a time in PDF format.

Chapter 2 (Control Structures) has a nice intro to coroutines in Simula and
iterators in CLU, including a funky implementation of the latter via C
macros that assumes you can get away with longjmp()'ing "up the stack"
(i.e., jumping back into a routine that has already been longjmp()'ed out
of).  Also an intro to continuations in Io:

    CLU iterators are truly elegant. They are clear and expressive.
    They provide a single, uniform way to program all loops. They
    can be implemented efficiently on a single stack.
    ...
    Io continuations provide a lot of food for thought. They spring
    from an attempt to gain utter simplicity in a programming
    language.  They seem to be quite expressive, but they suffer
    from a lack of clarity.  No matter how often I have stared at
    the examples of Io programming, I have always had to resort to
    traces to figure out what is happening.  I think they are just
    too obscure to ever be valuable.

Of course in the handful of other languages that support them, continuations
are a wizard-level implementation hook for building nicer abstractions.  In
Io you can't even write a loop without manipulating continuations
explicitly.

takes-all-kinds-ly y'rs  - tim