Feeds

Oracle de-cloaks JavaScript Nashorn project

JavaScript shall speak unto JVM

3 Big data security analytics techniques

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 three mobile application threats

More from The Register

next story
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Inside the Hekaton: SQL Server 2014's database engine deconstructed
Nadella's database sqares the circle of cheap memory vs speed
Oh no, Joe: WinPhone users already griping over 8.1 mega-update
Hang on. Which bit of Developer Preview don't you understand?
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
IRS boss on XP migration: 'Classic fix the airplane while you're flying it attempt'
Plus: Condoleezza Rice at Dropbox 'maybe she can find ... weapons of mass destruction'
Ditch the sync, paddle in the Streem: Upstart offers syncless sharing
Upload, delete and carry on sharing afterwards?
New Facebook phone app allows you to stalk your mates
Nearby Friends feature goes live in a few weeks
prev story

Whitepapers

Top three mobile application threats
Learn about three of the top mobile application security threats facing businesses today and recommendations on how to mitigate the risk.
Combat fraud and increase customer satisfaction
Based on their experience using HP ArcSight Enterprise Security Manager for IT security operations, Finansbank moved to HP ArcSight ESM for fraud management.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Five 3D headsets to be won!
We were so impressed by the Durovis Dive headset we’ve asked the company to give some away to Reg readers.
SANS - Survey on application security programs
In this whitepaper learn about the state of application security programs and practices of 488 surveyed respondents, and discover how mature and effective these programs are.