Live data from Hacker News

PurpleJS – An alternative to Node.js for Java projects

webagility.com

41–50 of 52 posts

Re: PurpleJS – An alternative to Node.js for Java projects

#41
post #37

simple question - can it work with npm dependencies out of box?

not out of the box, but the js vm used is based on webkit. for pure js deps, it can probably use them.

but maven repo is what you have out of the box which contains all (mostly) the libraries for java

Re: PurpleJS – An alternative to Node.js for Java projects

#42
post #39

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.

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 on…

The JVM is nowhere near as flexible as the CLR.

Re: PurpleJS – An alternative to Node.js for Java projects

#43
post #42
post #39

Earlier quoted context omitted.

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 on…

The JVM is nowhere near as flexible as the CLR.

The JVM probably lags behind in some aspects. But it's ecosystem is way larger and not biased towards Windows.

Re: PurpleJS – An alternative to Node.js for Java projects

#44
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).

[1]: http://jooby.org/

[2]: http://vertx.io/

[3]: http://www.rapidoid.org/

Re: PurpleJS – An alternative to Node.js for Java projects

#45
post #42
post #39

Earlier quoted context omitted.

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 on…

The JVM is nowhere near as flexible as the CLR.

In what way?

Re: PurpleJS – An alternative to Node.js for Java projects

#46
post #42

Earlier quoted context omitted.

The JVM is nowhere near as flexible as the CLR.

In what way?

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

Good luck at using pointers in Java.

Re: PurpleJS – An alternative to Node.js for Java projects

#48

This reminded me of Nodyn[1], a Node-compatible JVM implementation, which it appears is no longer actively developed. [1]: https://github.com/nodyn/nodyn#notice

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.

Re: PurpleJS – An alternative to Node.js for Java projects

#49
post #5

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. Once the docs are written... https://github.com/purplejs/purplejs/wiki/Embedding

Sorry about that. The embedded mode is not yet documented, but I can certainly help you with embedding into existing systems.

Re: PurpleJS – An alternative to Node.js for Java projects

#50
post #8

Isn't use case proposed by PurpleJS covered by Vert.x already? Or am I missing anything?

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.
Post reply on HN