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

Re: call/cc



"S. Alexander Jacobson" <alex@shop.com> writes:

> Ok, but multithreaded servers are relatively easy to understand.
> Passing contuations around seems harder.  (I've done the former but not
> the later).

Look at it from the vantage point of someone who's been introduced to
programming, but is a little foggy on how stateless HTTP works.

You're used to being able to get input by writing a prompt to the screen
and waiting for a line to be typed in.  Then your program processes the
input, making use of variables previously defined.  No problem.

Then all of a sudden you have to do web programming.  To get input, you
have to write out an HTML form, then return control to the web server.
You have to jump through hoops to save values of variables previously
defined, then restore those values at some unspecified point in the
future.

What continuations do is make web programming feel like the "prompt for
input and wait" method.  See the "Programming the Web with High-Level
Programming Languages" paper Shriram cited earlier, section 4.4, figure
4.  It illustrates what I'm summarizing here.  The example in that
figure would not look nearly so much like "prompt for input, then
proceed" if you had to fake it with closures.

I write this as an interested outsider; I haven't played much with the
plt web server myself.  It looks like a great tool for keeping
programmers from having to learn a lot about the web.  My own BRL is
more a tool to keep webheads from having to learn too much about
programming.

-- 
<brlewis@[(if (brl-related? message)    ; Bruce R. Lewis
              "users.sourceforge.net"   ; http://brl.sourceforge.net/
              "alum.mit.edu")]>