7 ms·
PurpleJS – A JavaScript application framework running on the JVM
- lazy_gator 10y agoThis is really cool. I saw that jjs was bundled with java 8, and saw this possibility. I wonder if it is compatible with node js frameworks like express. I think that node has a lot of native code to implement various functions, so it would probably require a lot of work.
- danielnesbitt 10y agoI remember reading about Project Avatar around the the time Java 8 was released. The intention was to support some of those native node modules. https://avatar-js.java.net/ https://avatar-js.java.net/ I guess it hit some roadblocks. https://blogs.oracle.com/theaquarium/entry/project_avatar_update https://blogs.oracle.com/theaquarium/entry/project_avatar_up...
- jbrat 10y agoApparently, the http framework in PurleJS is quite similar to express. Have a look at it!
- imeron 10y agoThis was already on Hacker News, here are the comments for that post: https://news.ycombinator.com/item?id=12755899 https://news.ycombinator.com/item?id=12755899
- agentgt 10y agoI don't know why this link keeps getting posted. Javascript on Java in server land has been around for some time and I even talked about some other frameworks that do this in a previous duped link https://news.ycombinator.com/item?id=12760128 https://news.ycombinator.com/item?id=12760128 I don't mind new libraries but it doesn't even explain how it is different or interesting or if prefers async to sync (I think it is sync). Hell you can even use Rhino Servlets like 15 years ago. The only thing that is new is Nashhorn but even that isn't that new. It is sad that Javascript is this sticky now.
- TheAceOfHearts 10y agoFrom their wiki [0]: > It's an alternative to Node.js for Java projects. PurpleJS makes it easy to build performant and lightweight Javascript server applications without the complexity of Node.js asynchronous programming model. Do you have any benchmarks that show what performance is like? I don't think you can avoid "the complexity of ... asynchronous programming model". The world is async, and we should build better tools to interact with it, not cover our ears and pretend otherwise. They also mention isomorphic applications, but the browser is async, because everything is event driven! How are you expecting to avoid that? Even if allowed to do some things synchronous (e.g. data fetching), it'll cause your UI to freeze. Both the browser and node use the `console` global for logging, but you've chosen to create a `log` object instead of following the existing convention. Even though I think `log` is a better identifier, I would've opted to maintain compatibility with existing ecosystems instead of doing my own thing. This got me to look up some info on Nashorn and I landed an Oracle article [1]. They use a `with` statement in one of the examples. I don't think I've ever seen someone using `with` in the wild. It's generaly frowned upon, and justifiably so, IMO. I couldn't find any info on what version of JS they support. Although full compatibility with node would be very challenging, I think you could get pretty far just by supporting CommonJS and the built-in modules. [0] https://github.com/purplejs/purplejs/wiki https://github.com/purplejs/purplejs/wiki [1] http://www.oracle.com/technetwork/articles/java/jf14-nashorn-2126515.html http://www.oracle.com/technetwork/articles/java/jf14-nashorn...
- smcl 10y agoI played around with Nashorn/jjs recently - if anyone's curious how roughly things work I did a little write-up here with a couple of examples showing some simple use-cases: http://blog.mclemon.io/discover-a-linux-utility-jjs http://blog.mclemon.io/discover-a-linux-utility-jjs
- softawre 10y agoWe are using J2V8, found Nashorn to be a bit lacking in performance.
- 10y ago
- Tzedek 10y agoJavascript madness finally on the JVM!
- norswap 10y agoAlso to be looked forward to, the Graal Javascript implementation (https://github.com/graalvm https://github.com/graalvm). It says supported, but I don't think they have started marketing it yet. Probably still has ways to go, but if it ends up as good as the Ruby implementation, there is much to hope for.
- self_awareness 10y agoNext logical step: Java JIT running on PurpleJS
- deleted 10y ago[deleted]
- roller 10y agoI normally turn to ringojs[1] for "off-browser javascript" with Java integration. It's been around nearly 20 years[2] now! Is this a new take on the same concept? The examples seem web application focused, but there's not even a mention of JSGI[3] or whether it was even considered. [1]: http://ringojs.org/ http://ringojs.org/ [2]: http://helma.org/ http://helma.org/ [3]: https://www.sitepen.com/blog/2010/01/19/commonjsjsgi-the-emerging-javascript-application-server-platform/ https://www.sitepen.com/blog/2010/01/19/commonjsjsgi-the-eme...
- agentgt 10y agoNot to mention there are dozens of other frameworks that support using Javascript directly like Vert.x, Jooby, Wicket (vaguely remember), Spring and even raw servlets and netty can all be programmed in Javascript using Rhino or Nashhorn.
- endymi0n 10y agoDoes it run http://doppiojvm.org/ http://doppiojvm.org/ ? Then we could run JavaScript on top of that!
- ninjakeyboard 10y agoINCEPTION
- asciihacker 10y ago> Combine the power of Java and your existing investments with the simplicity of JavaScript. I would much rather use Clojurescript and Clojure to cover this technical area.
- drivingmenuts 10y agoThe amount of code required just to write a "hello, world" is ridiculous. This thing that we programmers do is supposed to (I thought) reduce the complexity of writing code so we can focus on the problem. This takes it to a whole new level of "where the hell is the code that's actually doing what I want it to". It may work great and be horribly useful. But having to dig thru 4 subdirs just to get to the code that actually does something ... that was a horrible experience.
- jbrat 10y agoThis would be related to Java and Maven conventions, so you can easily handle tests, separate Java from Javascript - not a PurpleJS thing really.