Summary of lispvan September meeting - Client-side continuations for web programming
Monday, September 25, 2006
At the September lispvan meeting, James Wright presented an interesting "twist" on the use of continuations in web application programming: while most people who use continuations to maintain state do so on the server (e.g. - UCW, PLT Web Server, Seaside), James illustrated how similar results can be achieved by using continuations on the client. His jwacs library "is a program transformer that makes it easier to develop complex client-driven web applications by adding first-class continuation support to Javascript". According to James, the benefits of the jwacs approach are:
- Asynchronous operations written in a synchronous style: Traditional Ajax applications require the programmer to either write a maze of event handlers, or to provide only extremely simple and idempotent operations. Jwacs provides library functions that make asynchronous operations such as an XMLHttpRequest appear synchronous. Instead of scattering your logic across several fragmented event handlers, you can just write a step-by-step description of what the application should do.
- No special browser support required: Jwacs code compiles into regular Javascript that can be run by any standards-compliant browser, without the need to install any plugins.
- Integration with existing Javascript libraries: Why reinvent the wheel? Code written in jwacs works transparently with third-party Javascript libraries such as Prototype, Scriptaculous, and Dojo.
- Scalability: Unlike most other continuation-based web frameworks, jwacs continuations are stored on the client rather than the server. This gives you the advantages of a synchronous coding style without having to store a lot of per-user state on the server.

Jwacs is similar in goals but different in approach to Narrative JavaScript (which was released just before James released jwacs). Incidentally, anyone who is interested in innovative JavaScript approaches should subscribe to Chris Double's blog. He writes about a variety of different language topics, and has a bunch of interesting JavaScript posts that are definitely worth reading.
Luckily, the sound problems that plagued us at the August meeting didn't recur (yes, Marc, I tested the sound recording first this time! ;-) ), so I was able to successfully record the presentation. James also kindly provided the transcript of his presentation. Here are the links:
- Movie (about 52MB)
- Transcript

