Feeds

Oracle de-cloaks JavaScript Nashorn project

JavaScript shall speak unto JVM

Internet Security Threat Report 2014

A project to make JavaScript work better with Java is being kicked off with a boost from Oracle.

Oracle’s multi-language lead Jim Laskey has announced Project Nashorn, which aims to build a lightweight, high-performance runtime in Java using the native Virtual Machine (JVM).

Nashorn will start from scratch, using entirely new code, according to Laskey, with initial source coming from an unnamed Oracle internal project.

The new project will allow Java developers to embed JavaScript in Java apps using JSR-223 and to develop freestanding JavaScript apps using the jrunscript command line too. Nashorn will also use MethodHandlers and InvokeDynamic APIs, described in JSR-292.

“The goal is to provide a lightweight high performance JavaScript on a native JVM,” Laskey said in his project proposal to the OpenJDK here.

Laskey wrote:

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. Execution of JavaScript in this environment will be in conformance with ECMA-262 Edition 5.1 and will adapt to newer guidelines as standards evolve.

The project, part of the OpenJDK, will be moved to the OpenJDK repositories.

OpenJDK is the free and open-source implementation of the Java programming language, the project re-invigorated by Oracle once it took ownership of Sun Microsystems and which later attracted support from IBM and Apple after years in the wilderness thanks to industry politics.

Nashorn is the latest effort to diversify the languages supported by the JVM, a push that started under Sun to help ensure Java remained relevant in a world of growing language diversity.

JavaScript runs in a browser but making it execute in a JVM on the client or server has some benefits. It means apps written using JavaScript code can take advantage of a device or a server's CPU or GPU in performance.

JavaScript is finding its way on to the server in particular, thanks to PHP – one of the web’s most popular programming languages.

JavaScript is being mixed with other languages: it might call Java functions on a server and be used to retrieve data from PHP files, while PHP apps are being built that also use tabs written in CSS and JavaScript. Problem is, the transition to the server isn’t seamless, and apps that might work on a test machine won’t run on the main server.

Devs are using JavaScript because it dominates web programming and means a transfer of skills, but its downside includes having to deal with complex server-side issues such as scale and performance, running on multiple cores and keeping lots of long connections open.

You can already run JavaScript on the server using frameworks such as Node.JS, while there’s also Jaxer and Narwhal. Jaxer and Nawhal use a threaded model that suites web server development but which doesn’t scale well in applications running large numbers of processes or long connections. Node.JS has been getting a lot of interest because it uses event loops to run processes, helping JavaScript apps scale on the server. After initial enthusiasm, criticism of Node.JS set in - especially on its inability to scale.

An official project from the OpenJDK at least stands the chance of becoming something people agree on using, and could offer the industry an alternative that attracts critical mass and which isn’t subject to the waxing and waning fads of frameworks and languages. ®

Bootnote

Nashorn is the nickname given to a mechanised, WWII tank-busting gun built by the German army.®

Choosing a cloud hosting partner with confidence

More from The Register

next story
Netscape Navigator - the browser that started it all - turns 20
It was 20 years ago today, Marc Andreeesen taught the band to play
Sway: Microsoft's new Office app doesn't have an Undo function
Content aggregation, meet the workplace ... oh
Do Moan! MONSTER 6-day EMAIL OUTAGE hits Domain Monster
Customers freaked out by frightful service
Sign off my IT project or I’ll PHONE your MUM
Honestly, it’s a piece of piss
Return of the Jedi – Apache reclaims web server crown
.london, .hamburg and .公司 - that's .com in Chinese - storm the web server charts
NetWare sales revive in China thanks to that man Snowden
If it ain't Microsoft, it's in fashion behind the Great Firewall
prev story

Whitepapers

Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
Why cloud backup?
Combining the latest advancements in disk-based backup with secure, integrated, cloud technologies offer organizations fast and assured recovery of their critical enterprise data.
Win a year’s supply of chocolate
There is no techie angle to this competition so we're not going to pretend there is, but everyone loves chocolate so who cares.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Intelligent flash storage arrays
Tegile Intelligent Storage Arrays with IntelliFlash helps IT boost storage utilization and effciency while delivering unmatched storage savings and performance.