WASM on the JVM Ships Under the Bytecode Alliance

(foojay.io)

25 points | by dustingetz 15 hours ago

3 comments

  • zimmi 6 hours ago
    Do 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?
  • fwsgonzo 14 hours ago
    Is this going to be a way to execute emscripted-built projects locally? Or is the target something else entirely, like WASM interacting with Java?
    • cchianel 11 hours ago
      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 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).

  • iberator 11 hours ago
    Usecases?