Summary of lispvan August meeting - Web Continuations Considered Harmful
Saturday, August 19, 2006
Had a great presentation by Marc Battyani for our
August meeting of
lispvan. That's the good news. The bad news was that I did a
SnapZ
Pro screen capture of his presentation and somehow the audio
got fscked. :-( So, for those of you who sent me emails begging me to
video this presentation, I tried! Yet another reason not to EVER miss
attending a lispvan meeting in person!
In any case, here's a screen shot of an application built with a
combination of Marc's web application framework and his custom
hardware devices (in this case, the hardware device was a temperature sensor normally used in life sciences
applications to capture and transmit temperature readings; but, for
the demo, it was recording the termperature fluctuations during his
camping trip here in Canada):

Marc's web application framework was quite interesting. It's really a
combination of a framework and an application generator as he first uses forms to
define his application and then generates the code for the
application from these definitions. He generates the necessary Javascript to send updates to the server after
any field on an HTML page is changed by a user and to automatically
refresh fields on copies of the same data (which could be in the
process of being edited/viewed by another user or could be different windows that the same user has open on the same data). The benefit of this
approach is that the normal web application "state" issues become (effectively) a non-issue. Whenever a field changes
on one form, all instances of that field are updated everywhere. This
approach seems to work well for complex web applications where you
need to maintain a consistent state. However, it can also mean that
the application is quite "chatty" (Marc's applications typically can have
hundreds of users - it would be interesting to see how well this
approach would scale to very large numbers of users). Also, while the Back button on the
browser does take the user back to the previous page, the
"state" of the previous page has been affected by whatever field-level
changes have already been made. And, a browser bookmark that is saved
points only to the "key" to the data that was being edited on that
page, not the data itself. This does not therefore work the same way that
users would expect bookmarking to normally work. Therefore, the user-interaction model is more similar
to your typical desktop application than it is to your typical web
application. It is also quite a different approach to that taken by
continuation-based web application frameworks (where the "state" is
maintained at a page level and the back button does work as a means to
roll back to the data that was "in scope" in the prior page).
So, which is "best"? I don't think there is a black and white answer
to that. And, despite the title of the meeting, I think we were all
pretty much in agreement on most points during Marc's presentation and
the subsequent discussion. Avi Bryant (the author of the Smalltalk-based
Seaside web application framework and the web infromation
management application
Dabble DB) had a
good post on the different approaches to web development in his blog a few months ago. I'll paraphrase
what his conclusions were and put them into a CL context (they are
also listed in terms of greater levels of "state granularity" that
need to be maintained by the application):
- Need bookmarking or other external access: use REST. Most "traditional" web applications fall into this category and, in the CL world, you would probably be using one of the various lisp markup languages for this approach.
- Need back button, don't need bookmarking: use continuations/callbacks. The continuation-based web application frameworks fall into this category. There are several of these available for Scheme users, but in the CL world, you're limited to either UCW or LoL.
- Need quick response, but don't need back button or bookmarking: AJAX. Marc Battyani's approach falls into this category and, at the moment, I don't believe there are any other CL web application frameworks that fill this niche.

