107 points · by mindcrime · 12y ago · 66 comments
Nodyn is not yet complete, though I'd like to have a release in the next month that is capable of running express.js apps. It is slower than Node.js, but of course I'd like that to change; and with the JVM underneath, beating Node.js on performance is possible.
Nodyn is built on top of Vert.x (http://vertx.io) an asynchronous polyglot platform which excels on the Techempower benchmarks. The javascript runtime is DynJS - a new JS runtime for the JVM which is independent of Oracle. Though it's admittedly slower than Nashorn at the moment, we hope for that to change.
[1]: http://jxcore.com/
edit:
> All that with vert.x's powerful clustering technology built right in
I think I missed that part. Sorry =)
e: Thank you guys for the answers, definitely makes a lot more sense now.
To my mind, the idea of porting is that you face a choice: you can recreate the JVM functionality in your own runtime, or you can port to the JVM. Porting to the JVM is certainly non-trivial, but you then get thousands of man-years of work in return. It's certainly worth doing a project to see whether the porting effort pays off; especially if this done concurrently with working on the language's 'native' runtime.
As long as you aren't native, that is.
Although that's unrelated to the discussion at large.
My usual response regarding the merit of the JVM is this: there is a reason there's jvm on the server, desktop, on your phone, on the rovers on mars and god knows on how many mission critical systems.
And no it isn't because of great marketing, which is another common and lame response from JVM detractors.
The JVM is an impressive engineering effort and the eco-system spawned by it is currently unrivaled.
With the new trend of porting other languages (ruby,python,js..etc) to it, the I see the JVM as the middleware over which most future software would be built.
There's a node-ffi package, although it has some overhead from the call itself.
This would allow you to use NodeJS but still leverage the existing Java libraries, not requiring you to rewrite them.
Interop with the things that already exist in the Java ecosystem.
> I had this idea before that porting things like Ruby or Rails to the JVM was meant to offer ruby the advantages of having a java core (better threading, garbage collection, faster).
To the extent that those were effects of porting Ruby to the JVM they were mostly secondary, Java interop was the key feature (Rails, BTW, wasn't ported to the JVM, it just runs anywhere you have a functional Ruby implementation -- heck, before Ruby had executable specs, the test for a functional implementation was pretty much "does it run Rails".)
This makes a lot of sense.
Also, if you work at a Java shop having stuff run on the JVM affords a way to sneak in new tech. :)
[1] http://torquebox.org/ [2] https://github.com/jruby/jruby/wiki/Servers [3] http://www.restlessprogrammer.com/2013/02/multi-threading-in...
What is the source for that?
At present, there aren't nice binary downloads for anything that can just run node programs, I had to fiddle about a bit to get something I could play with, and even then, only some programs work - npm for example seems to go into a loop.
https://github.com/kybernetikos/avatarjs-sandbox/tree/master...
Also for anyone interested in an easy way to use the JVM for other languages, check out crudzilla.com . It is primarily for web development but has basic editor for other development work.
What am I missing?
Is someone working on it?
V8 is in many regards better (especially memory footprint and ramp-up time) or on par.
> clear access to Java directly in your Javascript.
Who needs this when having access to 50K nom packages?
EDIT : seems to be built upon Vert.x ? you can already code in javascript with Vert.x
As for coding Java on Nodyn, well, yes you can. That's kind of the point in some ways. You can write Java, package it as a jar and access this from Nodyn. Nodyn itself does this for the Buffer implementation.
Yes, vert.x already supports JS (I maintain the mod-lang-js, mod-lang-rhino and mod-lang-dynjs language modules for vert.x). The idea behind Nodyn is to provide drop-in Node.js compatibility in the Vert.x environment.
This way you write JS for Node and you can run it under either Node or the JVM.
That said, I'd suggest running node wither a service oriented architecture if both were non-negotiable requirements.