Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don’t know of any Java compiler to WASM with WASI. The GC model may be a bit experimental for now, since GC is only a phase 2 proposal.

Although; do we need a compiler for Java? It may be going full circle.

> One benefit of using wasm is architecture-agnostic binary. Right now you can't run x86 binary on ARM or vice-versa.

That was the advantage given for the JVM. The .jar ran on x86 and ARM.

Running raw WASM is similar to running Java bytecode, but with fewer cross-platform APIs.



I was talking about ordinary Java projects.

Yes, we need a compiler for Java. Java sources are compiled to Java bytecode along with many other actions for complex projects like downloading dependencies, generating sources, running tests which might run platform-dependent binaries and so on.

> That was the advantage given for the JVM. The .jar ran on x86 and ARM.

Yes, wasm and Java bytecode are the same in that regard. But Java bytecode failed to get adoption outside of Java world. Wasm might not, we will see. One significant improvement of Wasm over Java is good security story. Java sandbox is well known for its CVEs. Browser wasm implementations are battle-tested on billions of devices in the wild Internet. So you basically can't run untrusted Java bytecode without further boundaries like KVM or at least containers. But you definitely can run untrusted Wasm bytecode because that's what your browser does all the time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: