WASM on the JVM Ships Under the Bytecode Alliance
1–8 of 8 posts
Re: WASM on the JVM Ships Under the Bytecode Alliance
#2Re: WASM on the JVM Ships Under the Bytecode Alliance
#3Re: WASM on the JVM Ships Under the Bytecode Alliance
#4Is this going to be a way to execute emscripted-built projects locally? Or is the target something else entirely, like WASM interacting with Java?
As an example of how it can be used, you can look at https://github.com/Christopher-Chianelli/timefold-wasm-servi... and https://github.com/Christopher-Chianelli/timefold-wasm-c-cli..., which was an experiment I did to try using C code inside Timefold Solver (a Java library that can be used to solve constraint problems like Employee Scheduling and Vehicle Routing).
Re: WASM on the JVM Ships Under the Bytecode Alliance
#5Re: WASM on the JVM Ships Under the Bytecode Alliance
#6Usecases?
> You didn't install a native binary. You didn't configure JNI. You didn't cross-compile anything for your target platform. It just works, because the Wasm module is hiding inside a regular JAR on your classpath.
> WebAssembly changes this equation. Take a proven C or Rust library, compile it to Wasm, and run it within JVM boundaries. You keep everything the JVM gives you: guaranteed memory safety, fault isolation, platform independence, advanced JIT, observability, and the "write once, run anywhere" promise. The Wasm module becomes just another artifact inside your JAR, an implementation detail that your users never need to think about.
And from TFA[2]:
> The previous article focused on wrapping C and Rust libraries. Those languages compile to Wasm straightforwardly because they manage their own memory. But a growing number of languages target the WasmGC proposal instead: Kotlin/Wasm, Dart, and others. Google Sheets already runs its Java-based calculation engine through WasmGC in production. Endive passes the full WasmGC spec testsuite
[1] https://foojay.io/today/a-new-generation-of-java-libraries-i...
Re: WASM on the JVM Ships Under the Bytecode Alliance
#7Do I understand correctly that endive ships with a garbage collector and only uses the host gc when references pass over the API boundary? I don't know much about wasm, but would it be possible to use the host gc for everything? Or is there some inherent property of wasm that makes this impossible / less efficient?
Re: WASM on the JVM Ships Under the Bytecode Alliance
#8Is this going to be a way to execute emscripted-built projects locally? Or is the target something else entirely, like WASM interacting with Java?
Think of WASM as a kinda universal library target. You can compile C, Rust, C#, Java to WASM, and then you can use it in a different language from the source. This way, Java can run C or Rust code without going through a FFI (foreign function interface). From the article, one example is porting tree-sitter (a C library) to Java by first compiling it to WASM, then use Endive to access its function. As an example of ho…