Nodyn - Node.js On The JVM
Written by Ian Elliot   
Monday, 10 March 2014

JavaScript continues its relentless advance on other hapless languages. Now we have Node.js running under the JVM which more or less universal - well as universal as Java. 

nodyn

 

Nodyn is an a superset of Node.js which runs on top of Dyn.js. This is a JavaScript bytecode compiler that makes use of the dynamic features of Java 7. It is a fully open source alternative to Oracle's Nashorn JavaScript compiler.  

Nodyn is also open source with an Apache licence and a product of the Project:odd team at Red Hat. It isn't a port of node.js but a complete re-write making use of the vert.x application platform.  

projectodd

The main advantage of Nodyn is that it allows JavaScript access to Java. While the two languages share the word "Java", in normal use that's about all they do share. You could  make use of the foreign function call in node.js, but Nodyn is much more direct and easy to use.  To quote:

"... imagine running your node app on the JVM where you immediately have access to all that the Java world has to provide - directly from Javascript. You've got the entire Java ecosystem at your disposal. Since DynJS is cross-language compatible, why not throw in a little JRuby or Clojure with your app if you want."

At the moment only a relatively small part of the node.js API has been implemented - the all important HTTP, UDP, URL, Utilities, Timers,Stdio and so on have been completed. But work is yet to start on arguably as important modules such as HTTPS. It is early days. but I doubt you could just take your existing node.js application and run it under DynJS. 

The approach to the conversion is:

"In some cases, we’ve copied the Node.js javascript files as-is. When the Node.js source is dependent only on Javascript bits, and nothing in the C bindings, there’s no need to rewrite it all. In other cases, where Node.js depends on C bindings, we’ve got our own spin on things with the vert.x engine or even just plain old Java code."

Essentially most of the work seems to be refactoring the C dependencies of node.js. 

How influential will Nodyn be? 

A very good question. It all depends on how many projects there are that would benefit from JavaScript/Java server-side integration. 

nodyn

 

More Information

Nodyn

DynJS

Vert.x

http://projectodd.org/

Related Articles

Nashorn A New JVM JavaScript       

Help Higgs Compile JavaScript       

Getting Started with Node.js

Asm.js Gets Faster

Java, ASM.js Or Native - Which Is Faster?

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, FacebookGoogle+ or Linkedin,  or sign up for our weekly newsletter.

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Banner


1000 Programmer's Mugs
06/12/2024

It is legend that programmers run on coffee so what better as a festive gift than a new mug with an appropriate slogan? You could boost your favourite programmer's performance by encouraging increased [ ... ]



Pico 2W Announced But There Is A Surprise!
25/11/2024

Raspberry Pi released the Pico 2 a few months ago and we have been waiting for the Pico 2W since then. But Pimoroni beat them to the draw with the Pico Plus 2W based on the RM2 radio module and hinted [ ... ]


More News

Last Updated ( Monday, 17 March 2014 )