mohanraj nagasamy

Interesting Project: Nashorn

I am going to cover some of the interesting or odd projects that are being targeted to run on jvm that I came across recently in this multi post blogs.


Nashorn is an upcoming JavaScript engine, developed fully in Java 8 Language by Oracle. And open sourced to OpenJDK as part of jdk8. It also validates the InvokeDynamic (JSR-292) feature in JDK 7; leverage all new language and JVM features in JDK 8.

We know the existing jvm (from jdk 1.1 onwards) ships with JavaScript engine, which is called Rhino. But the recent version of Rhino has only been tested with JDK 1.4 and grater. I don’t know who in the world is using jdk 1.4 anyway.

So what is need for the new project?

Rhino is old code base and developed by using old jdk. And Nashorn significantly outperforms Rhino, it may not beat Google’s V8. And Nashorn implements a new meta-object protocol that simplifies calling Java APIs from JavaScript, and enables seamless interactions between JavaScript and Java. And all the JVM TI based tools such as debugging and profiling can read meta-object protocol.

But the real motivation for writing a new engine to validate InvokeDynamic feature, which formally opened the door to support non-Java languages on jvm.

Nashorn engine passes ECMAScript 5.1 compliance tests. You can follow Oracle’s blog for the updated infos. It is an interesting project to checkout.