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. My latest book is Fifty Quick Ideas to Improve Your Tests. 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

How to get more value out of user stories

Impact Mapping

Leave a Reply

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