Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using Continuations to Maintain State on the Web

1 view
Skip to first unread message

William E. Byrd

unread,
Nov 19, 2002, 10:12:54 PM11/19/02
to
Several research papers have been written on using continuations or
continuation-passing style (CPS) to allow a Web-based application to
maintain conversational state (e.g., see Graunke, et al.,
"Automatically Restructuring Programs for the Web", at
http://www.ccs.neu.edu/scheme/pubs/ase2001-gfkf.pdf). I am aware of
only one commercial Web-based application that uses this approach.
Can anyone point me to sucess stories, failures, or lessons
learned/best practices with respect to the use of continuations to
maintain state on the Web? I am particularly interested in the use of
continuations or CPS in large, complex commercial sites.

Thanks.

--Will

David Rush

unread,
Nov 20, 2002, 7:49:24 AM11/20/02
to

This is probably a bit too pat, but virtually any event-driven program
that maintains state between events is effectively using a crude,
hand-compiled form of CPS. I'm currently building a multi-million user
app (in a language that shall remain nameless, but isn't Scheme) and I
keep wishing for full continuations. I've even named parts of my
internal data structures apropriately so that future generations will
be subtly indoctrinated into the mysteries...

david rush
--
Scheme: Making Turing Machines obsolete.
-- Anton van Straaten (the Scheme Marketing Dept from c.l.s)

Avi Bryant

unread,
Nov 20, 2002, 5:21:03 PM11/20/02
to
emacs...@yahoo.com (William E. Byrd) wrote in message news:<80adcf89.02111...@posting.google.com>...

I maintain a framework written in Smalltalk that is built on this
approach. It provides many useful patterns (embeddable display
components with independent threads of control, expiring transactions,
UI state rollback, page-level call/answer, callback-based links and
forms) on top of the basic continuation style describe by Quiennec and
later papers. I have used it to build moderately complex internal
applications for more than one company, but have never deployed it in
a high volume situation (the resource usage, as you might expect, is
fairly high).

I don't have any papers to point you to, but I'm happy to correspond
with you about my experiences developing and using it.

The framework itself is available from http://beta4.com/seaside2 .

MJ Ray

unread,
Nov 20, 2002, 8:54:18 PM11/20/02
to
William E. Byrd <emacs...@yahoo.com> wrote:
> I am aware of only one commercial Web-based application that uses this
> approach. Can anyone point me to sucess stories, failures, or lessons
> learned/best practices with respect to the use of continuations to
> maintain state on the Web? I am particularly interested in the use of
> continuations or CPS in large, complex commercial sites.

The scratchpad of the Apache Cocoon project includes (at least, when I last
checked) a scheme interpreter for implementing application flow in terms of
continuations. I think it follows this sort of style. Searching the
cocoon-dev mailing list for talk of "schecoon" may give you some of the
answers you seek.

Sorry for being so vague,

MJR

MJ Ray

unread,
Nov 21, 2002, 6:36:20 AM11/21/02
to
Avi Bryant <a...@beta4.com> wrote:
> (the resource usage, as you might expect, is fairly high).

Why should I expect the resource usage to be fairly high? How high is high?

I remember iowa.
--
MJR| v
---|--[ Something else will appear here eventually, I guess... ]-----|
`--[ http://mjr.towers.org.uk/ ]---------[ slef at jabber.at ]-----'

Avi Bryant

unread,
Nov 22, 2002, 4:06:19 AM11/22/02
to
On Thu, 21 Nov 2002 03:36:20 -0800, MJ Ray wrote:

> Avi Bryant <a...@beta4.com> wrote:
>> (the resource usage, as you might expect, is fairly high).
>
> Why should I expect the resource usage to be fairly high? How high is
> high?

Well, I keep a continuation for each page view, a closure for each link or
form input, and a journal (actually a copy-on-write tree) of the UI state
of the session. This is in Squeak, which uses a naive, unoptimized
representation of closures and continuations, and it's in the range of a
few k per page view, usually. Not a big deal for the applications I've
been doing, but it's a typical criticism of the approach.

> I remember iowa.

Seaside is a whole lot further along than IOWA was. But the lineage
shows, if you squint ;).

Avi

0 new messages