Oracle Proposes Nashorn JavaScript Engine for OpenJDK

Oracle has officially proposed the Nashorn Project, an implementation of a lightweight, high-performance JavaScript runtime for Java, as a new project for OpenJDK. Nashorn is the Oracle-developed JavaScript engine spotlighted at JavaOne and scheduled for inclusion in Java 8.

The project (pronounced "NAZ-horn"), aims to enable Java developers to embed JavaScript in Java applications via JSR-223, which is the mechanism for embedding scripts in Java source code, and to develop free-standing JavaScript apps using the jrunscript command line tool. JSR-223, better known as "Scripting for the Java Platform," is independent of specific scripters. It was included in the Java SE 6 platform release.

Oracle announced last week that Nashorn, which began as an internal project to create a JavaScript engine for the company's HotSpot JVM, would be open sourced and migrated to the OpenJDK repository.

The project was proposed on the OpenJDK mailing list by Oracle software engineer John Coomes, who posted the official CFV (call for votes). Coomes, who is the OpenJDK HotSpot Group lead, proposed Oracle's Multi-language Lead, Jim Lasky, as the initial Nashorn project lead, and HotSpot as the sponsoring group.

The project will comprise, Coomes wrote in his CFV, 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 that byte code. "Execution of JavaScript in this environment will be in conformance with ECMA-262 Edition 5.1," he added, "and will adapt to newer guidelines as standards evolve."

One of the project's goals is to improve on existing technology, including the Rhino, the open source JavaScript engine developed by Netscape and maintained by the Mozilla Foundation. "This project will be an entirely new code base, focused on [newer] technologies," Coomes wrote. "In particular the project will utilize the MethodHandles and InvokeDynamic APIs described in JSR-292." Rhino is currently embedded in J2SE 6 as the default Java scripting engine.

OpenJDK is the free, open source implementation of the Java Standard Edition (Java SE) specification. It is licensed under the GNU General Public License (GPL) with a linking exception. (The GPL linking exception exempts components of the Java class library from the GPL licensing terms.)

Only current OpenJDK members are eligible to vote on the proposed project, and voting it set to run through December 6. A new Nashorn blog has also been launched.