Agile Ajax

>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).

Why should you care about continuations? Because, like it or not, it is one of the things you can do in JavaScript and, given that as the complexity of client-side code increases, you may want to have some long running tasks on the browser. You can't always use a framework like Narrative Javascript or jwacs (see below), so sometime you may have to roll your own.

P.S. For another system similar to Narrative Javascript, check out jwacs (Javascript with advanced continuation support).

Technorati Tags: ,

Topics:

Leave a comment

Powered by WP Hashcash

About Pathfinder

  • We design and build extraordinary applications for companies looking to make the next great idea a reality.
  • learn more

Topics

WordPress

Comments about this site: info@pathf.com