Hacker News new | ask | show | jobs
by jedisct1 38 days ago
Not very hard... Rust wasm binaries are ginormous.

If you care about WASM performance, size and memory usage, Zig is a much better candidate.

1 comments

Not necessarily true (especially with the new Zig Io interface), a vanilla Rust Hello World compiles to a 40 KBytes WASI blob, while a vanilla Zig Hello World compiles to 45 KBytes. Both are in the same ballpark. The vanilla C Hello World on the other hand comes out at around 4 KBytes (with the caveat that the compiler is free to replace a non-formatting printf with a direct puts call).
Been keeping an eye on the progress of NetWasm... it looks like recent versions have trimmed it further. It's down to 38 KB with WASI P2.