Slide 24
Slide 24 text
WASI Shims
https://github.com/bjorn3/browser_wasi_shim
let args = ["bin", "arg1", "arg2"];
let env = ["FOO=bar"];
let fds = [stdin, stdout, stderr, new PreopenDirectory(".", [
["main.rb", mainRb],
])];
let wasi = new WASI(args, env, fds);
let wasm = await WebAssembly.compile(fetch("bin.wasm"));
let inst = await WebAssembly.instantiateStreaming(wasm, {
"wasi_snapshot_preview1": wasi.wasiImport,
});
wasi.start(inst);