[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Y Store /Closures

   >What is the difference between a Web app vs other apps?
   I am not entirely sure that I have been following all of this, since I 
   have never
   written presentation-tier web apps stuff myself, but I presume that the
   interesting issue here is the need for coroutining that comes up because of
   the structure of the way HTTP interactions and web browsers work.  Each
   click on a browser button invokes a little subroutine, which runs and 
   a result, which the user at the browser sees as the next page.  But from the
   point of view of writing the application, it is inconvenient (sometimes 
   to the
   point of being utterly unacceptable) to have everything be "event-driven"
   in this way. There is state to be maintained between one click and the
   next, and you sometimes want that state to be expressed as "control state"
   (i.e. in the "PC" and the "stack", to use the "vulgar" terms) rather than as
   state stored away in variables or files or databases.  Hence the interest
   in continuations.  (Correct me if I'm wrong.)
No - I think you have it right.

   Now, here's what I want to know. Suppose you want to write a web
   app that maintains state between clicks in the fashion I've been describing,
   but you don't want all that state to be lost in case there is a reboot or
   power failure or crash. In the event-driven style, the state can be stored
   persistently, in a file or database system, so that when the next HTTP
   request comes along, you can pick up where you left off, but in a 
   language-with-continuations scenario, the continuation state is all in 
   memory and lost when there's a crash.  What can anyone recommend?

Well, you asks a question I've been struggling to understand as well
(but you say it much more clearly than I could have :) . I've been
reading thru the Queinnec's papers, and Avi's comments (haven't had
time to download/play w his framework yet). My guess is that they
would respond w/ a. it's not important -- and this cps style for web
apps is really intended for state that you don't care to "continue"
with or b. postulate that the infrastructure/language should provide a
way of dumping / resuming computations.

The other dimension that I've been struggling to understand is how
these facilities interact with modern load-balancers. Having the state
maintained in a file/db allows for the machine that serves the "next"
page hit to be a different one than the first (as j2ee or .net
environments do). Is passing cps/vm state between multiple cpu's a
well understood problem in Smalltalk or Scheme these days -- maybe
there's been progress on this problem that I am unware of. 

I have other conceptual struggles as well.. such as how the
HTML-CSS<->language interface truly works (note that the Java/Zope
solutions have clear answers here even though they are suboptimal
perhaps :)