3 ms·
I think it depends on what your WASM runtime supports. The OP here is using a runtime called Wazero, which looks like it supports the first prototype of the WAS
by kibwen 4y ago
I think it depends on what your WASM runtime supports. The OP here is using a runtime called Wazero, which looks like it supports the first prototype of the WASI standard. You can think of WASI like libc for WASM, where it defines interfaces for operating with the underlying system. But WASI is still young and changing, and doesn't support everything that a program might want to do. And certain contexts, like web browsers, probably have no interest in providing runtimes that have full WASI support.
If you're interested, I'd suggest compiling a crate for WASI and seeing if you get compilation errors. You can do so by cross-compiling for the `wasm32-wasi` target (`rustup toolchain install wasm32-wasi`, then `cargo build --target wasm32-wasi`). If your program tries to use any stdlib facilities that don't exist on that target, it will tell you.