NetWasm is an independent compiler, core library, runtime and SDK that compiles C#/.NET CIL directly to WebAssembly and produces standalone WASI Preview 2 components. The headline finding is that NetWasm 0.8.0 with its precise Compact garbage collector produces a 47,798‑byte raw Wasm (13,501 B Brotli) for a simple print-42 workload, undercutting Rust 1.95.0 built with a size-oriented profile at 53,635 B raw (16,963 B Brotli) - 10.9% smaller raw and 20.4% smaller compressed. Comparable footprints for Kotlin and TinyGo are provided for context. The artifacts include the runtime and precise GC and the comparison is presented as a matched workload/output measurement rather than a blanket language-size ranking.
Functionally, NetWasm supports C# 15, web workers, static .a interop, WIT/WASI P2 bindings, expression trees without general runtime reflection, HTTP/JSON/XML/Regex libraries, reflection-free dependency injection, unit testing, wasm64, and ordinary dotnet CLI workflows; published components run on Wasmtime. Size comes from closed‑world compilation, a smaller platform contract, generated interop boundaries, optional inclusion of data/diagnostics, and linking only one chosen collector. Four allocation strategies are provided (Compact default 47,798 B; NetWasmGC 51,300 B; Bump 43,794 B; Boehm 74,142 B). NetWasm is pre‑1.0 and excludes broad runtime reflection, dynamic assembly loading, managed threading and some I/O surfaces.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.