We have successfully built libjxl for wasm, a task that wasn’t easy but we managed to complete. Now it’s time to run it using different WebAssembly runtimes for Go developers. The first runtime we try is wazero, which claims to be a zero-dependency runtime. However, during the initial setup, we encounter an error related to invalid bytes for import limits. Upon further investigation, we find that the Wasm standard specifies a flag of 0 or 1, not 3. Moving on to wasmer-go, a mature runtime based on Wasmer, we face another error regarding thread enablement for shared memories. Surprisingly, there seems to be no means to enable threads in the runtime’s documentation. Lastly, we try wasmtime-go, which uses the Wasmtime project written in Rust. Before even running our code, we encounter a warning about the requirement for an executable stack. After addressing this issue, we face a new error related to missing imports. Although the imports seem simple and obvious, they are not documented. Despite these challenges, we manage to get the libjxl wasm library working, but not without some struggles and frustrating moments. The post highlights the complexities and difficulties encountered in utilizing different Web
https://flak.tedunangst.com/post/www-which-wasm-works