QCon London 2009: Script JVM with JavaScript and get stack-based continuations

Attila Szegedi today suggested using JavaScript as a scripting language for server side JVM systems, during his JavaScript in the Enterprise talk at QCon London 2009 conference. Szegedi named stack-based continuations as a huge advantage of that approach. Stack-based continuations are effectivelly asynchronous calls with a callback, but without the weird code that typically comes with closures, asynchronous calls and callbacks.

Basically, the idea is to:

  1. interrupt the call, grab stack, store and execute the call asynchronously
  2. when the response comes in, pull the stack out and continue working
  3. physical thread is free to keep working on something else meanwhile
  4. not write this explicitly, have the framework do it for you so that code looks like the usual procedural program

Szegedi demonstrated this approach with the Mozilla Rhino JavaScript runtime engine. He also mentioned two pre-processing tools that extend JavaScript with new operators and pre-compile from human-readable javascript-like syntax into javascript code which utilises stack-based continuations.

I’ll be covering QCon London 2009 in detail on this blog. Click here for all news and reviews from the conference

I'm Gojko Adzic, author of Impact Mapping and Specification by Example. I'm currently working on 50 Quick Ideas to Improve Your User Stories. To learn about discounts on my books, conferences and workshops, sign up for Impact or follow me on Twitter. Join me at these conferences and workshops:

Specification by Example Workshops

Product Owner Survival Camp

Conference talks and workshops

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>