Updated: 11/5/2005; 6:04:40 PM.
Chris Double's Radio Weblog

Saturday, August 30, 2003

Bill Clementson provides links to more papers on continuation based web servers. In another post Bill points out that Paul Graham used a similar approach in Viaweb (written in Common Lisp).
12:42:27 PM      

Continuation based web servers provide a way of modeling the flow of a web application in a procedural manner. Instead of worrying about how to get inputs through forms and pass that data via the session to other forms you can write your code almost exactly like a normal procedural application and it 'just works'. For example:

  (define n1 0)
  (set! n1 (read-first-number))
  (display-result-page n1 (read-second-number n1))
This code could be a standard Scheme application to accept two numbers entered at the keyboard and displayed on the screen. The exact same code will display a web page. The user enters the first number. Then the second page is displayed. The user enters the second number and the result is displayed. The workflow of the application is very easy to follow from the code.

Other continuation based web frameworks are:

  • Cocoon Flow. A Java based framework that uses an extended JavaScript interpreter (extended to allow continuations). A testimonial from a blogger who sees the advantages of continuation based web applications.
  • Seaside. A continuation basd web application framework written in Smalltalk. Includes a simple Smalltalk development system 'in the browser' as an example, including the traditional code browser and debugger. A tutorial here.
  • The PLT Scheme web server is continuation based.
  • Sisc Scheme includes an example in the contrib module of a continuation based servlet that runs under a Tomcat.

To understand the implementation details of this type of web server design I've built a simple continuation based server that runs under Sisc. It allows dynamically adding pages and continuation based control flow from the REPL while the web server is running - dynamically updating without having to bring the server down. It took a short time to wrap my head around how the continuation control flow is implemented but once done it is very easy to understand from a users perspective. My main reason for doing this is to play around with this style of web application development and to try out Sisc's ability to persist and restore continuations.

12:55:21 AM      

Some papers on continuation based web servers:
12:44:34 AM      

I've been playing around with Sisc, a Java based Scheme system. It's very full featured and includes fully serialisable first class continuations. This means you can take a continuation, persist it to disk, a database, or send it to another machine over a network. You can then load it back and call it. Very neat. This would work particularly well with a continuation based web server allowing the session to be shared across machines for load balancing - something web servers with this design tend to have problems with.
12:33:29 AM      

Mark Watson asks "Why don't more People use Prolog". He includes a link to an LGPL embeddable Prolog interpreter. A little known fact is that there is an embedded Prolog interpreter in Windows NT. Another application that uses Prolog, Tivoli, could be considered to be one of the largest commercial uses of Prolog around.
12:20:26 AM      

Bill Clementson has moved his Lisp weblog to his own web site rather than blogspot.
12:15:52 AM      

© Copyright 2005 Chris Double.
August 2003
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Jul   Sep

Click here to visit the Radio UserLand website.

Listed on BlogShares

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.