Zero C#: C# compiled to native without runtime or GC
Zero C# is a fork of the bflat compiler that compiles C# directly into small native programs without requiring a .NET runtime or garbage collector. It retains C#‘s syntax, type checking, and features like generics, interfaces, and threads, but replaces runtime-managed memory with arena-based allocation, where memory is freed in bulk. The same source code runs on Linux, macOS, Windows, WebAssembly, and even DOS on a 386, producing minimal binaries (e.g., 11 KB on Windows, 40 KB on Linux). Exception handling is replaced with union-based error returns, and reflection/async are omitted. The project emphasizes cross-platform compatibility and minimal dependencies, with examples showing identical code building for multiple targets.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.