C# with a deliberately smaller runtime model
A new experimental project called Zero C# is presenting a stripped-down route from C# source code to native programs that run without the .NET runtime or a garbage collector. Built as a fork of the bflat compiler, the project retains familiar language features including static type checking, syntax and generics while replacing managed-runtime services with explicit, limited alternatives.
The resulting programs require only a platform's C library, according to the project's documentation. The same source can target Linux, macOS and Windows, as well as WebAssembly through WASI and DOS on a 386-class machine. Its examples are checked with a common test suite to confirm that each target produces the same output, although the toolchains and final linking steps differ by platform.
That portability does not make Zero C# a drop-in replacement for conventional .NET development. Removing the runtime changes how applications handle memory, strings, collections and input or output. In particular, objects created with `new` are not automatically reclaimed. The project instead supplies arenas, which allocate related objects together and release the entire group at once when its lifetime ends.
Explicit memory and a compact library
Zero C# includes a small supporting library designed around those constraints. Strings that must remain valid are stored in an arena, while list and dictionary types use arena-backed handles. Formatted output writes directly into an output buffer, and line input is read into spans. The approach puts lifetime decisions in the programmer's hands and avoids the pauses and machinery associated with garbage collection, but it also requires applications to be structured around predictable allocation phases.
The project says its updated safety rules continue to check ordinary C# code while distinguishing pointer creation from operations that dereference pointers. Documentation explains the unsafe boundary and provides a tutorial that moves from a basic program to an interactive console application.
Its cross-platform demonstrations use different routes to native execution. A Linux build produces a program linked against the C library. On macOS, bflat compiles the source and Apple's clang performs native linking. Windows output can be cross-built from Linux or macOS and tested under Wine. The WebAssembly target runs through NativeAOT-LLVM and wasmtime, while the DOS build turns the same bitcode into a 386 executable tested with an emulator and extender.
Zero C# is best understood as a technical experiment for small, controlled programs rather than a claim that the broader .NET ecosystem is unnecessary. Existing .NET applications commonly depend on managed allocation, reflection and extensive runtime libraries that this design intentionally omits. Its value lies in testing how much of C#'s compile-time language experience can survive when the execution layer is reduced to native code, explicit memory lifetimes and a minimal standard library.



