Feeds

Oracle de-cloaks JavaScript Nashorn project

JavaScript shall speak unto JVM

Remote control for virtualized desktops

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

Internet Security Threat Report 2014

More from The Register

next story
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
You stupid BRICK! PCs running Avast AV can't handle Windows fixes
Fix issued, fingers pointed, forums in flames
Microsoft: Your Linux Docker containers are now OURS to command
New tool lets admins wrangle Linux apps from Windows
Bada-Bing! Mozilla flips Firefox to YAHOO! for search
Microsoft system will be the default for browser in US until 2020
Facebook, working on Facebook at Work, works on Facebook. At Work
You don't want your cat or drunk pics at the office
Soz, web devs: Google snatches its Wallet off the table
Killing off web service in 3 months... but app-happy bonkers are fine
prev story

Whitepapers

Why and how to choose the right cloud vendor
The benefits of cloud-based storage in your processes. Eliminate onsite, disk-based backup and archiving in favor of cloud-based data protection.
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.
10 threats to successful enterprise endpoint backup
10 threats to a successful backup including issues with BYOD, slow backups and ineffective security.
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.
Protecting users from Firesheep and other Sidejacking attacks with SSL
Discussing the vulnerabilities inherent in Wi-Fi networks, and how using TLS/SSL for your entire site will assure security.