2 ms·
One reason is that the Zig toolchain has fewer "moving parts" than the Emscripten toolchain (e.g. Emscripten depends on Node.js, Python, the Google Closure comp
by flohofwoe 3y ago
One reason is that the Zig toolchain has fewer "moving parts" than the Emscripten toolchain (e.g. Emscripten depends on Node.js, Python, the Google Closure compiler with an embedded Java runtime, and various WABT tools), and while all these tools are installed automatically by the Emscripten SDK installer, it's still a lot of individual parts that can break.
OTH the Clang compiler doesn't come with the necessary cross-compilation C library and headers.
From that pov, the Zig toolchain is indeed the best option to compile a WASM blob that's not WASI (in that case, there's also the WASI SDK, which is a similar self-contained toolchain as the Zig toolchain) - PS: Zig can also compile to WASI out of the box though.