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.®

Top 5 reasons to deploy VMware with Tegile

More from The Register

next story
Bada-Bing! Mozilla flips Firefox to YAHOO! for search
Microsoft system will be the default for browser in US until 2020
Be real, Apple: In-app goodie grab games AREN'T FREE – EU
Cupertino stands down after Euro legal threats
Download alert: Nearly ALL top 100 Android, iOS paid apps hacked
Attack of the Clones? Yeah, but much, much scarier – report
Nexus 7 fandroids tell of salty taste after sucking on Google's Lollipop
Web giant looking into why version 5.0 of Android is crippling older slabs
SLURP! Flick your TONGUE around our LOLLIPOP – Google
Android 5 is coming – IF you're lucky enough to have the right gadget
Microsoft: Your Linux Docker containers are now OURS to command
New tool lets admins wrangle Linux apps from Windows
prev story

Whitepapers

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.
Getting started with customer-focused identity management
Learn why identity is a fundamental requirement to digital growth, and how without it there is no way to identify and engage customers in a meaningful way.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Website security in corporate America
Find out how you rank among other IT managers testing your website's vulnerabilities.
Top 5 reasons to deploy VMware with Tegile
Data demand and the rise of virtualization is challenging IT teams to deliver storage performance, scalability and capacity that can keep up, while maximizing efficiency.