Jeremy Hylton : weblog : 2003-12-11

Stackless Zope

Thursday, December 11, 2003, 12:12 a.m.

Christian Tismer has a demo of Stackless Zope. It's a simple demo where the user code contains a for loop with a raw_input(). Each of those calls generates a new web form -- all inside the body of the for loop. The programmer's mental model and the code actually match up!

If I follow this correctly, Christian has built a continuation-based web programming environment for Python. Shriram Krishnamurthi has been saying this is the essence of web programming. I've been meaning to read and think more about it, but haven't found the time. I think the paper to start with is:

Graunke, Krishnamurthi, Van der Hoeven and Felleisen. Programming the Web with High-Level Programming Languages. ESOP 2001.

Queinnec is working on this too: Continuations allow web applications to be written in direct style that is, as a single program that displays forms and reads form submission since continuations automatically capture everything (control point, lexical bindings, etc.) that is needed to resume the computation. Programming is therefore safer, easier and more re-usable.

Aaron Watter's new xsdb uses Stackless to for its server mode. Why? On the Stackless list, Aaron wrote: Unrolling the application at each point where you need to waitsimply turns the code inside out (just like unrollinga set of recursions). Threading is the onlyacceptable alternative.

Aaron also says: I really think stackless type functionality makes a tremendous amount of senseand I still wish it would get folded into standard Python. It's worth considering again. I don't know if anyone has the time and effort to make it happen.