Hacker News new | ask | show | jobs
by chubot 2620 days ago
This previous thread covers differences between the JVM and WebAssembly:

https://news.ycombinator.com/item?id=19502702

tl;dr

- JVM doesn't do enough to separate computation and I/O

- JVM doesn't run C code very well, or it requires research-level technology to do so (Graal). This applies to both computation and I/O -- it has a completely different I/O interface than C programs rely on.

- Photoshop / Word / Excel / etc. were never ported to the JVM. The browser actually has better equivalents of them.

2 comments

That last one is really stupid.

The reason they weren't ported is because they were legacy codebases with some code going back to the original versions including lots of assembler. It was always going to be a monumental task to rebuild them from scratch.

That you don't have to rebuild such apps from scratch on WASM is exactly the point.

You can compile legacy codebases in C and C++ to WASM. It was designed for that. Doing that on the JVM requires "research-level" techniques because the bytecode has a completely different design.

Actually there was an Office like suite written in Java, e.g. Corel Office for Java.

JVM separation between computation and IO can be managed via classloaders and JAAS.

OpenOffice / staroffice were also partially Java based for a while if I remember correctly
They could use whatever JVM one has installed, but the dependency became optional and can be turned off (Tools->Options->LibreOffice->Advanced on LibreOffice). I keep it turned off as I don't have Java installed anywhere and probably I lose some features in the process, but I don't recall having any problems in normal use. I'm definitely not an advanced LibreOffice user though.