Show HN: Zero C# – C# without a runtime or GC
- ID
- 49313
- Status
- summarized
- Published
- 21 Nov 2026, 11:39 PM
- Fetched
- 23 Nov 2026, 8:15 AM
- Provider
- Hacker News
- Category
- dev-community
- Original URL
- https://onurgumus.github.io/zero-csharp/index.html
- Source URL
- https://hnrss.org/best
Summary
- Score
- 6.5
- Created
- 23 Nov 2026, 8:16 AM
- Tags
- Audience
- developers
What happened
Zero C# is a fork of bflat that compiles C# straight to native binaries with no .NET runtime and no garbage collector — Hello World is 11 KB on Windows, 40 KB on Linux, and 46 KB for a Linux x64/arm64 build that needs only libc. Memory comes from arenas freed all at once, and the same source targets Linux, macOS, Windows, WebAssembly, DOS on a 386, and bare-metal UEFI (a 15 KB .efi started by firmware from a USB stick). You keep C# 15 features like unions, extension members, real generics with static abstract members, records, tuples, lambdas, and Parallel.For, but lose the GC, reflection, async, and exception catching — throw ends the program, so errors come back as unions.
Why it matters
If you ship CLI tools, WASM widgets, or anything where 'install the .NET runtime first' is a real adoption tax, an 11-46 KB self-contained binary is a concrete distribution change you can test this week with `dotnet new zero` and one `ZeroTarget` property. The tradeoff is explicit and you should decide before porting: no async, no reflection (types can be compared but have no name), and no exception handling — so any code path relying on try/catch or `await` needs rewriting to union-returned errors.
Discussion angle
The no-GC arena model plus no-async and no-reflection is the whole design bet — which of your tools (CLI utilities, WASM plugins, DOS/UEFI toys) actually fit that constraint set, and where does losing try/catch force an ugly rewrite?