It’s pronounced ‘naz-horn’
JVM JavaScript engine Nashorn open sourced
Nashorn,
the successor to the Rhino JavaScript engine for the JVM, has been
submitted to the OpenJDK. In a
message to the OpenJDK announcements mailing list, Nashorn
Project Lead, Jim Laskey and OpenJDK HotSpot Group Lead, John
Coomes, have formally proposed the creation of the project.
Providing a good overview of the project, the pair describe Nashorn
as a “lightweight high-performance JavaScript runtime in Java with
a native JVM”, allowing development of “free standing JavaScript
applications using the jrunscript command line tool”. It will
replace the aging Rhino engine currently maintained by Mozilla
(‘Nashorn’ is the German word for Rhino), utilising the
MethodHandles and InvokeDynamic APIs of the Da Vinci Machine,
JSR-292.
They continue: “The scope of this project will include, but is not
limited to, a parser API for scanning JavaScript source code, a
compiler to convert ASTs from the parser to JVM byte code, and a
runtime to support the execution of said generated byte
code.”
Nashorn has been developed internally by Oracle for some time, with
solid details only emerging
at this year’s JavaOne. At that time, the team reported 99.99%
compliance with ECMA test262, considerably higher than Rhino, which
has 95.90% compliance.
It seems that the elusive 0.01% has been overcome, however, with
the writers announcing a 100% compliance rate, “the current status
of this project is that further work needs to be done on
performance and hardening before it can be considered ready for
general use.”
One particularly hyped aspect of Nashorn is the ability to run
node.js, the trendy method of developing server-side applications
using JavaScript. Using Node.jar on Nashorn, unmodified node.js
scripts can apparently be run on the
JVM.
Voting is open to existing OpenJDK members until December 6 -
although it seems unlikely that such a high-profile project would
be turned away.
Follow us