Just before Devoxx, the LJC held a Nashorn HackDay in conjunction with Oracle.

Nashorn, in case you’re new to it, is a brand-new implementation of Javascript which runs on top of the JVM.

There is already an existing JS-on-JVM implementation, called Rhino (after the animal on the cover of the O’Reilly Javascript book), which was developed by Mozilla. It is quite old, and was not architected in a way which makes it easy to update it to take advantage of modern JVM features. Having said that, Rhino (at least in its interpreted mode) is quite simple to understand, so if you’re interested in how an interpreter is implemented on top of the JVM – then you should look at the Rhino source code.

With Java 8, however, Nashorn (pronounced NAS-horn, not NASH-horn) replaces Rhino (Nashorn is actually the German word for Rhino) – and Rhino is being removed.

Nashorn is a from-scratch new JS implementation, and designed to take full advantage of all Java 7 & 8 features – including method handles and invokedynamic. It is the first JS implementation to pass the spec tests 100%.

It will ship with Java 8, but it is already & pretty good shape, and with the interest in it, we decided to take it for a spin before Devoxx…

The Hackday took place at Oracle’s Moorgate building – and we were very pleased to have Attila Szegedi, one of the Oracle engineers working on Nashorn as our guide.

Attila opened the day with a presentation about how to use the JS shell (jjs) & how to integrate running Java code from within JS (and how to use Java to call out & run JS scripts from within a Java program).

In the hack sessions, people focused on using Java libraries from Java, comparing JSON processing in JS vs in Java (& some rudimentary benchmarks) with more advanced users looking at trying to defeat the Nashorn security model & sandbox.

It seemed to go very smoothly, and if there’s interest, we’d definitely be keen to run more events focused on Nashorn over the Summer – let us know if this would be interesting (leave a comment below or email us).

-Ben