Like always, browsers are a funny ecosystem and very unpredictable. In all this time I thought that I could see a rise in the adoption of C and Rust libs by the community through WASM but now instead we are building around AssemblyScript. Touche.
Rust has the most developed ecosystem but the best experience I've had otherwise was with Zig. It's reasonably easy to write and can produce excellent final wasm size. The only problem is that the compiler is currently exporting every public symbol in the standard library but when I hacked up the compiler to only export a hard coded list of symbols I got ~150 bytes for add (the WASM hello world) and easily sub 1k for the type of modules the post is discussing.
zig build-lib add.zig -O ReleaseSmall -target wasm32-freestanding -static
You can debug the linker invocation with `--verbose-link` on the end of that.The issue tracking the problem is: https://github.com/ziglang/zig/issues/7133
> a new language like C
is a funny thought ^_^