August 2007
Nice Post on Continuations in Javascript
Continuations are one of the more confusing aspects of programming languages. For those languages that do implement it, such as Ruby and Scheme, it is one of their darker and more confusing corners, waiting to catch the novice developer with inscrutable code. I blogged a while back about Narrative Javascript, a preprocessor that lets you transform your complex, long running Javascript code into cooperative multitasking elegance; Narrative Javascript did the continuation dance under the covers. For those of you who want to understand continuations, what they are, how they work and how they can be implemented in any language that has closures, check out this post, entitled Continuation-Passing Style and why JavaScript developers might be interested in it, from Marijn Haverbeke. It's a very approachable explanation of continuations in Javascript (or, if you want something a little more general, check out Continuations for Curmudgeons, and equally entertaining romp through that dark corner).
May 2007
GWT and Comet - Using GWT with Jetty Continuations
by 1 otherLet's review: Comet basically means keeping an HTTP connection open between the server and the browser so the former can stream messages to the latter without polling (see the Ajax Patterns page on HTTP Streaming for info on how it's done). This poses a problem for commonly used web infrastructure, like app servers, which usually associate one thread per connection. If you have lots of open connections, let's say 10,000, then you will need that many threads that are doing very little but sitting around waiting for the next message to be sent. Regardless of OS, 10,000 threads puts a pretty heavy load on a system. As a solution, Greg Wilkins proposed an extension of the Servlet standard to allow "continuations." What are they?
1
(2 marks)