Live data from Hacker News

CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

leaningtech.com

21–30 of 179 posts

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#23

On the flip side, is there a JVM-based Wasm interpreter? JNI is great and all, but I love the thought of compiling native code to WASM to provide a single package for all plaform without extra redundant packages.

Graalvm targets WASM, 'work in progress'

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#24

I was hoping to see an AOT - but they say that currently it is just interpreter + JIT. This is beneficial for compatibility but counterproductive for speed. Nevertheless, an interesting project.

Do any of the native AOT implementations outperform the best JITs?

I remember trying bcc’s Java compiler years ago, and it was significantly slower than standard JITted Java, but maybe better systems exist.

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#25
post #21

Just in case those who prefer not to allow Java need this, here's some info about disabling WASM in various browsers. https://github.com/stevespringett/disable-webassembly

Might be worth mentioning that Java applets could call into native DLLs (which was a major security risk), while there's no way to do the same from WASM.

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#26
For anyone looking for a free similar alternative (no swing), I can recommend doppio. I used doppio to provide an online version of the open source language interpreter I am building, you can try it here: https://www.timestored.com/jq/online/

The main pain is that it's really really slow to load on firefox.

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#27
post #13

This is pretty awesome technically. Java everywhere without a JVM install. What's its footprint?

Yeah it's not really JVM.

The thing with these kinds of ports is that they do some 'neat stuff' but ultimately, they don't come close to the real thing, often, not close enough to be a material substitute.

The JVM is a very sophisticated and nuanced thing, 'duplicating it' and the standard libs is a very big deal.

Theses are cool projects though and they have their use.

Re: CheerpJ 3.0: a JVM replacement in HTML5 and WASM to run Java on modern browsers

#30
For anyone interested in the Kotlin side of things:

Kotlin has a great compat with Kotlin/JS[0]. they also have Compose For Web which is more WASM based[1] though its marked as experimental

[0]: https://kotlinlang.org/docs/js-overview.html

[1]: https://github.com/Kotlin/kotlin-wasm-examples/tree/main/com...

Post reply on HN