[plt-scheme] web programming, continuation, CPS transform, etc.
On 5/3/07, YC <yinso.chen at gmail.com> wrote:
> > > Understood. I would say that the ilities are probably neither better
> > > nor worse than you would expect, but just different. We have, in
> > > effect, run a many-year experiment using Continue, a semi-commercial
> > > Web application for conference paper management written entirely in
> > > PLT Scheme (continue.cs.brown.edu ). Over the years we have gradually
> > > refined our understanding of its performance, and some of Jay's work
> > > on continuation replacement strategies (not written up anywhere, but
> > > I'm sure he can say more here if he feels inclined) stems from our
> > > observations of this system (and of its sibling, Resume, which handles
> > > the faculty job ads for Brown CS and was also used at Northeastern CCS
> > > this past year).
>
> Thanks - hopefully Jay would be feeling inclined to share ;)
The vanilla server originally used simple timeouts to reap the memory
of old continuations. I found that using a LRU replacement policy
works wonders. This is available in the SVN server as `continuation
managers', the two most useful being: timeouts.ss and lru.ss. Noel
recently sent mail to the list with a simple servlet using it.
Secondly, I found it fairly simple to contain coarse information about
the continuation in the URLs generated by the server. These
information can be used if the continuation id refers to a dead
continuation. If that is the case, such information can reconstruct
the continuation coarsely.
For example, suppose you have the k-url:
http://localhost:8888/servlets;1*2*3/servlet.ss
which is instance 1, continuation 2, which refers to the list of
papers, you could instead give the URL:
http://localhost:8888/servlets;1*2*3/servlet.ss;place=list
If continuation 2 is alive, the extra URL content is ignored.
Otherwise, the servlet can, say, redisplay the login and then go
directly to the list.
The PLaneT module url-param.plt helps with this process.
I've found this very simple to do in Continue (a very large
application), only about 50 lines of code to get a fair coverage of
the possible coarse continuation locations.
Jay
--
Jay McCarthy <jay.mccarthy at gmail.com>
http://jay.teammccarthy.org