Not sure if this is on topic because I'm not using...
# webassembly
m
Not sure if this is on topic because I'm not using Kotlin/Wasm, but the solution is probably related. How can I use a WASM library in a Kotlin/JVM project? It's really hard to search for because I keep getting Kotlin/WASM results. I don't want to compile Kotlin to WASM, I want to use a compiled WASM library from my Kotlin/JVM project.
r
You should probably look at https://github.com/CharlieTap/chasm
thank you color 1
m
If it is really only JVM then you can also use https://github.com/dylibso/chicoryhttps://github.com/dylibso/chicory or https://www.graalvm.org/latest/reference-manual/wasm/ Chicory, e.g., has the advantage that it can also do JIT and AOT compilation and not just interpret the Wasm code.
e
it may have helped if you searched for a "wasm runtime"
m
@ephemient Hah yes, I learned that's the term from chasm's description
Chicory and GraalWasm look interesting too! I will read up about all these
e
afaik chicory and graal don't support wasm-gc at this point so they can't run kotlin/wasm (which wasn't what you asked for, just noting)
m
The library I'm trying to run was written in Rust, so I'm guessing wasm-gc isn't required.
👌 1
s
here's the link to Chicory , since it's a wasm runtime implemented in Java, you don't need native interop, so that's a big plus.
m
Oh, you do need a lot of interop to call any wasm method via Chicory. Whether you want to call that native or not is another story. You cannot just call a Wasm method like it where a Java method. Extism may be helpful for that.
m
Extism looks very interesting! I will give it a go
đź‘€ 1
m
@Marcin Wisniowski Please report back. I’d be interested because I haven’t yet tried it myself. Only tested the three runtimes directly.
a
@Marcin Wisniowski If you only need JVM and you WASM binary is single threaded and does not use GC, than Chicory may be a good choice. Note that it has an AOT compilation option. I just finished a Gradle Plugin that allows you to precompile WASM into a .class for use in JVM and Android projects with Chicory: https://github.com/illarionov/wasm2class-gradle-plugin.