Fork me on GitHub
Adam Helins07:02:33

Graal can run WASM, but here is an old tweet mentioning Graal running as WASM: I cannot find any recent info about that, but it makes you dream about running Clojure JVM in the browser one day

Shantanu Kumar10:02:13

Reminds me of Blazor (from .NET camp) that can run webapps.


Big problem with WASM for JVM is no multi threading and no garbage collection. Both are being worked on however. It's scope is quite limited though. Like all http calls need be done via javascript.

Adam Helins13:02:23

Multi-threading is already kind of possible but relying on webworkers and experimental features (and/or poorly supported ones such as SharedArrayBuffers). Future will tell how well the end result compares to actual OS threads. GC is definitely something to think about. I don't know where the current proposals is leading. In anycase, for instance, Graal's native image embedds a GC when needed. If they do plan to target WASM (which is not unthinkable), they might be able to reuse all that, who knows. And regarding stuff like http calls going through JS (or any IO, really), this is just temporary. The end goal is clearly to expose browsers API directly to WASM but some work elsewhere needs to be done first to be effective (eg. type interfaces for exchanging complex types such as strings). The future looks very promising :)