I particularly don't find the problem it solves appealing. The power of Node comes specifically from its everything async programming model, Javascript is just a detail.
So what's the point in taking away the good part, and keep the cumbersome one? If you just want to program a Synchronous server in the JVM,just stick to Java.
> If you just want to program a Synchronous server in the JVM,just stick to Java.
And if you want to program an asynchronous server on the JVM in Java, all of the major and minor servers also support an asynchronous model (you merely lose the ability to program against the Servlet API, which pre-3 was bound to threads).
There's no reason at all to bring JS in for asynchronous behavior.
There is also Vert.x which runs on the JVM but is event driven and asynchronous (as well as providing a reactive API) and supports JavaScript (http://vertx.io/docs/vertx-core/js/) as one of its languages.
I hope you don't mean the JVM by "the cumbersome part". It think is unparalleled in performance, garbage-collection, general dev-ops and monitoring capabilities.
You can run many different languages on it, all nicely contained within the virtual machine.
As far as I know Twitter replaced their Ruby/Rails with Code on top of the JVM for these reasons.
Also I don't think it's good to religiously stick to async/"just one thread" and sync/"one thread for everything". The most performant answer depends on the real world scenario and almost always lies somewhere in between.
The CLR can be used to run C++ code compiled with the C++/CLI (/clr:pure) setting of MSVC.
Java apps can even run on the CLR because of IKVM (https://www.nuget.org/packages/IKVM).
Why do people think async code is complicated and keep trying to replace it?
I think there are just people who will never understand or fully grok the beauty, power and simplicity of functional programming and will always seek to replace it. I feel sorry for them.
Vert.x is similar. PurpleJS tries to make development of your webapps easier by combining the require-js model and a "sinatra"-way of developing rest endpoints.
I have seen several similar things that essentially use existing Java libraries or the libraries themselves offer it (Javascript).
* jooby [1]
* Vert.x [2]
* Rapidoid (I can't find the exact link where JS was used) [3]
I'm just not entirely sure why you would trade a language that is generally much safer for one that is known to be problematic at scale particularly since Java 8 has lambdas so you can do callback async style if you like. I mean I suppose you could use typescript but at that point why not stick with Node and if you need JVM stuff just make some sort of microservice to access it from Node.
If it is a learning thing than (as Java is complicated) than Clojure is far better option (I'm always amazed how easy it is to learn any Lisp as syntax becomes a non issue).
No, sorry, no benchmarks yet. The main focus until now has been to speed up the development process. Right now it's pretty slick when it comes to reloading of resources on-the-fly when changed.
I'm just not sure I see the value... and in the end, not sure it will work out any better than the DLR attempts with .Net... It's interesting, just not sure I see the value. The Java runtime is about 60mb to download, then the extras for this... vs Node's runtime download under 14mb with a similar amount of library downloads for a given project.
That doesn't include the disconnect from the rest of the JS ecosystem which has centered around npm at this point (at least for the package repository itself, baring the yarn front end).
Perhaps that's closer to ClearScript (https://clearscript.codeplex.com/) in the .NET environment - although ClearScript has a broader area of application and supports multiple engines.
This could be pretty cool. So in theory, all the Java, Scala, etc servers out there can wire up an isomorphic single page app without calling out to a Node process.
No, Nodyn tried to be fully compatible with NodeJs. PurpleJS is just an alternative - the scope is not to be fully compatible. Also Nodyn has it's own implementation of Javascript. PurpleJS uses Nashorn as the Javascript engine.
Rhino got a poorly documented rewrite and is a pain to use, JDK 8 forward there's Nashorn. Elsewhere I've used J2V8, a very lightweight wrapper around V8
Ok, that's part of it. This line from the page is what gets me, "create server applications with Javascript but access and use Java libraries" and I think an example of that is very important.
Actually, the best example of that is already mentioned in the article:
"With Enonic XP, the combination of Java and JavaScript is used to speed up the development process and allow frontend developers to implement backend services. I saw that this was a very popular approach to develop software more effectively, and wanted everyone to be able to use the technology for free and in existing investments. PurpleJS was born."
PurpleJS is the core of Enonic XP, made available separately as an open source project (well, both are open source).
Thanks. Last time I looked at JS in Sun Java, it was in interpreter mode only due to license issues, so I always bundled Rhino with my projects to be able to precompile JS code, so it will run faster. But now performance of Nashorn is pretty impressive: https://blogs.oracle.com/nashorn/entry/nashorn_performance_w... .
So what's the point in taking away the good part, and keep the cumbersome one? If you just want to program a Synchronous server in the JVM,just stick to Java.