[racket] Server side continuations

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Mon Jun 13 18:39:30 EDT 2011

On Mon, Jun 13, 2011 at 5:37 PM, Eli Barzilay <eli at barzilay.org> wrote:
> On Friday, Shriram Krishnamurthi wrote:
>> I wonder if he's read the structure of JavaScript programs, which --
>> because of the cooperative multi-tasking structure of JavaScript --
>> have to return control to the event loop (ie, "terminate") whenever
>> they make an Ajax request, leaving *another procedure* to pick up
>> the response if and when it arrives.  What a nifty pattern -- I
>> really wish it had a name!  Oh wait, I guess these days it's called
>> "Ajax" -- which makes it all good.
> But of course ajax is too vague an low level -- so it's wrapped in
> things like node.js.

This statement is very confused.  Ajax is a technique for single-page
communication with the server from a browser.  node.js is a
stand-alone version of V8, the Chrome JS engine, designed for
server-side use a la Python, Ruby, Java, or Racket.

People do use libraries to make Ajax easier, but those are things like
jQuery, Dojo, and Prototype.

> I've recently looked at it (node.js) in an
> attempt to figure out what's all the noise about, and it's surprising
> how little you get from it.  Practically any text on it explains the
> IO problem and then goes on with examples like
>    foo(1, 2, function(x,y) {
>      ...
>      bar(x+y, function(z) {
>        ...;
>        })})
> But nobody minds the extra work -- and that seems to be achieved
> through some very specific vocabulary, words like "hotness" and "add
> some awesome" tends to get a certain kind of people all excited (eg,
> "nodejitsu").  Not to mention the many places that refer to it as
> "non-blocking evend-driven", and conclude (with a straight face) that
> it's a real-time high performance system.

node.js does deliver impressive performance.  The non-blocking nature
of JS I/O is annoying -- that's why Dave created task.js, as I pointed
to earlier, but it also allows node to scale to large numbers of
connections much more easily than similar systems written in other

The node.js crowd has the annoying tendency to act like they've
invented non-blocking I/O, but it's a good idea anyway, and node is
actually a system that lots of people are accomplishing impressive
things with.
sam th
samth at ccs.neu.edu

Posted on the users mailing list.