Compiling C to WebAssembly Without Emscripten
> C without the standard library (called “libc”) is pretty rough<p>If you don't want to pull in musl or a traditional libc, there's a more Wasm-y solution known as the Web Assembly System Interface (WASI) [0] that delegates the libc functionality to the runtime.<p>A WASI Wasm module can be compiled using clang, as in the article. The only difference is to use the WASI sysroot [1].<p>> optimization<p>LTO and -O3 are great! I've also found the Twiggy [2] tool useful for more "manual" optimization.<p>[0] <a href="https://wasi.dev" rel="nofollow">https://wasi.dev</a>
[1] <a href="https://github.com/CraneStation/wasi-sdk/releases" rel="nofollow">https://github.com/CraneStation/wasi-sdk/releases</a>
[2] <a href="https://rustwasm.github.io/twiggy/" rel="nofollow">https://rustwasm.github.io/twiggy/</a>