continuations

Spreading the meme

March 8, 2004 22:56:26.137

Ken MacLeod has a good post on continuation-based web frameworks. One quote I found interesting was this one:

Different "panes" (as opposed to frames, ick) can be in different "threads" of continuation without affecting each other as the user navigates through each request.
As far as I know, this particular feature is unique to Seaside. If anyone knows of other systems that support this, I'd like to hear about it - I'm curious to see how others went about implementing this.

Ken also hints that continuations may be getting more widespread in the future:

The Apache Java Cocoon folks ... implemented continuations in JavaScript within Cocoon Flow.... Python is wavering on the edge of support for continuations; this could be the killer use case for continuations in Python. Perl 6 will have continuations.
I'm very interested in hearing about any projects to bring continuation-based web frameworks to new languages. I'd be happy to act as a consultant on such projects, sharing some of the experience I've gotten over the last couple of years building Seaside and deploying Seaside applications, even if I don't have time to directly contribute code. For that matter, if someone wants to hire me to write a Seaside-like framework in Python, Ruby, Javascript, Java, and so on, I'm all ears; adapting the design to a new environment would be an interesting challenge. I wouldn't expect to be able to reproduce everything the Smalltalk version supports, but I'd be shocked if we didn't end up with something a far sight better than what's available now.

(Well, I can dream, can't I?)

Comments

Python

[Matthew] March 11, 2004 21:00:38.493

I'd love to see a continuation-based web dev framework in Python. I wonder if it'd be possible using mod_python and Apache?

Python

[Avi Bryant] March 11, 2004 23:05:51.841

Is there a mod_stackless_python? That's what you'd need to use. Though it would be easier to use FastCGI or the like, since you can't (AFAIK) rely on getting the same interpreter instance for all requests to the same session if you use a module.

Continuation-based Web frameworks in python

[Thibault Estier] March 12, 2004 9:25:39.297

I'm seriously investigating the question of "seasiding" python. Continuations in python have already been studied by several persons. While there is nothing as smart as smalltalk blocks in python, I believe continuations can actually be elegantly implemented in python. I have no resource and actually very few time, but I'm ready to cooperate and possibly comment and document "uncommented features". (thibault@inextenso.com, a colleague of Ian who writes the "learning seaside" blog).

WebObjects

[Peter William Lount] March 12, 2004 15:13:40.803

NeXT's and now Apple's WebObjects enables the capability of different "panes" or "frames" having different and independent "states" or "context" without using continuations. This capability is nothing new, only using "continuations" for this seems to be new.

WebObjects

[Avi Bryant] March 12, 2004 16:01:41.238

Peter, I'm quite familiar with WebObjects, but you're missing two points:

  • WebObjects does have a fairly nice "component" model for breaking a page into independent parts, but most of the continuation based web frameworks out there do not. Seaside combines WebObjects-style components with continuation-based session management. I'm not claiming to have invented either concept, but Seaside was definitely the first to combine them. Reconciling those two models was not a trivial thing to do.
  • Although each individual page in a WebObjects app can be broken into components, I believe the control flow is still at the whole-page level. When you return a new component from a WebObjects action method, what you return becomes the root component of the next page. In Seaside, a component deep within the page can "call" another component and *only it* gets replaced by the new component. That's what makes these "panes" truly independent: you can literally embed an entire application within another and it will work perfectly, oblivious that it's only getting a small part of the total real estate of the browser window.

Some Python related (?) work

[holdenweb] March 29, 2004 12:09:34.834

I recently poresented a paper on some work I've been doing, initially in VBScript but now just moving towards a halfway-decent python implementation despite the distractions of having to earn a living. A couple of people have suggested similarities with Seaside and similar systems, so this post is mostly just a stake in the ground and an attempt to make contact. The brief (and somewhat inadequate) description of wehat I currently call the "?stacking web framework" can be seen at http://pycon.org/dc2004/talks/index_html#web-context, and slides plus notes from the paper are available from http://pydish.holdenweb.com/Context.pdf.gz (and should also be available from the PyCON site later). Steve Holden