Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

It's "Tarver".

I'm surprised he's initially targeting JavaScript. I would think the JVM would be a more useful initial target.



sort by: page size:

From the post: "This project intends to enable Java developers to embed JavaScript in Java applications and to develop free standing JavaScript applications using the jrunscript command line tool."

Java -> Javascript -> (v8) -> assembly = JVM

Javascript madness finally on the JVM!

It seems like a major motivation for this project is to be able to use Java libraries from Javascript (a la Jython). There are a non-negligible number of libraries that only exist for Java, and being able to harness those from JS sounds nice to me, even if it means taking a performance hit.

Well, it's for the JVM, JS or Linux native. :-)

Point taken about the tutorials. It's still a work in progress.


Oh, it looks like Xtend is to Java as Coffeescript is to Javascript. Although I'm sceptical about it compiling to Java source.

Java seems to be going through a period of experimentation, and alternative Java-like and JVM languages. Interesting times.


You missed the most relevant one that even comes bundled with the JDK, JavaScript.

> J2Cl which translates Java to Javascript

Oh that's sure an interesting project. A shame it apparently requires the use of Bazel as the build system. I wish I could just add it as a module to my existing Maven project and rewrite my frontend code from TypeScript to Java — but that's Google, and Google can never stop inventing their own ways of building things.

edit: I might try https://github.com/Vertispan/j2clmavenplugin


Looks really good, but I fear the name might be a bit deceiving. I've found most Java libraries start with J, and most JS libraries end with JS(processing.js, popcorn.js, three.js), so I initially disregarded it as a Java library when I was just skimming the page.

No, it's using Nashorn which is bundled with Java 1.8+. It compiles Javascript into JVM bytecode as Rhino, but it's more performant.

It compiles to JVM bytecode and JavaScript currently. JetBrains is working on a native port as well.

Uses the JDK standard library currently.


TeaVM compiles to JS and includes the basic JRE runtime. Still very lightweight!

Why would you code in Javascript on the JVM to begin with if you have existing projects and libraries written in java ? that's stupid. If the goal is async IO there is Vert.x and other non blocking servers already. Not even talking about cases when libs require C++ extensions... Can you code in Java on Nodyn? no

EDIT : seems to be built upon Vert.x ? you can already code in javascript with Vert.x


+1 for TeaVM. Not only is there the Fermyon friendly fork, but WASM/WASI/debugging is seeing a large number of checkins in recent weeks in the main fork.

However, true "Java Geeks" should try the JavaScript support in TeaVM. It is mature and battle-tested. The resulting code runs great in a browser.

Live TeaVM-based game: https://frequal.com/wordii

Getting started with TeaVM: https://frequal.com/TeaVM/

Performance Comparison: https://frequal.com/java/TeaVmPerformance.html


Originally built on Java

I would recommend vert.x too.

But only because I'm used to nodejs and this is the jvm equivalent.


Gavin's looking for positive feedback on this since he wants the community to buy into this, so please give encouragement if you want this feature. It's currently experimental and only works on the JavaScript runtime, but they'll implement it for the JVM runtime as well if it's well received.

Do you mean written in Java, or targeted to the JVM?

Apologies if this is a dumb question -- I haven't read this yet.


It's written in Java ;)
next

Legal | privacy