3 ms·
> a single-file distribution literally won't be possible Actually. You could compile the Rust into Wasm, then the Wasm into C. Firefox did this last year [1]
by ReactiveJelly 4y ago
> a single-file distribution literally won't be possible
Actually.
You could compile the Rust into Wasm, then the Wasm into C.
Firefox did this last year [1], so the tools exist and it's neither totally impossible nor totally stupid.
The penalty is less than JITting or interpreting Wasm.
wasm2c is the tool they apparently used in 2021. [2]
[1] https://hacks.mozilla.org/2021/12/webassembly-and-back-again-fine-grained-sandboxing-in-firefox-95/ https://hacks.mozilla.org/2021/12/webassembly-and-back-again...
[2] https://github.com/WebAssembly/wabt/tree/main/wasm2c https://github.com/WebAssembly/wabt/tree/main/wasm2c
> wasm2c takes a WebAssembly module and produces an equivalent C source and header.