RingoJS is a JavaScript platform that runs on the JVM. It was started by Hannes Walln?fer and is the successor to Helma and HelmaNG. RingoJS conforms to CommonJS standards and supports features like hot reloading, profiling, debugging, and sandboxing. It can run as a standalone process or within a web application container since it runs on the JVM. Examples are provided of using RingoJS for multithreaded JavaScript and web applications using libraries like Stick. Community support is available on IRC and Twitter. RingoJS can be used for standalone applications, extending existing Java web apps, and code reuse between server and client-side JavaScript.
3. Overview
? started by Hannes Walln?fer
? successor to Helma, HelmaNG
o been in development for 13+ years
? runs on the JVM
? uses Mozilla Rhino
? conforms to CommonJS
8. Hello World, Take Two
new require('ringo/httpserver').Server({
app: function() {
return {status: 200,
headers: {},
body: ['Hello World']}; }
}).start();
9. Multithreaded JS
// run "test" in "threads" parallel threads a total of "count" times
function?parallel(test,?count,?threads)?{??var?pool?=?new?
????
java.util.concurrent.Executors.newFixedThreadPool(threads);??functio
n?runnable(f)?{??
??return?new?java.lang.Runnable({?run:?function()?{????
??try?{?f();?}?catch(e)?{?}??
??}});??}??for(var?i?=?0;?i?<?count;?i?++)????
pool.execute(runnable(test));}
10. RingoJS libraries
? search GitHub for ringo-
ringo-admin?install?
user/repo
? use rp and packages.ringojs.org
rp?install?name
13. Community
? #ringojs on Freenode IRC
? #ringojs & @ringojs on Twitter
? http://github.com/ringo
14. Use Cases & Benefits
? standalone
? to extend an existing Java webapp
? plugin architecture for existing application
? code reuse between server and browser
? less context switching
? more compact code, faster prototyping