bflat is a C# compiler that produces small, self-contained, and native executables using Go-inspired tooling.
bflat merges the Roslyn C# compiler with NativeAOT, an ahead-of-time compiler for .NET, into a single cross-compiler and runtime. This combination lets developers write C# code with access to the latest language features while compiling directly to native machine code, eliminating the need for a .NET runtime to be installed on target systems. The tool can produce native executables or shared libraries callable from other languages via FFI, and supports multiple platforms including x64 and arm64 variants of Linux, Windows, Android, and UEFI.
bflat suits developers who want the expressiveness of C# without the tooling complexity of the standard .NET ecosystem. It removes the dependency on dotnet, MSBuild, and NuGet, making it ideal for projects that need standalone binaries or tight size constraints. The tool comes with two standard libraries: the default DotNet library provides the familiar .NET standard library, while the Zero library offers a minimal alternative for extremely constrained environments. By default, executables range from 1 MB to 2 MB, but developers can optimize for size by disabling reflection, stack trace data, globalization, and exception messages. The tool targets developers comfortable with command-line workflows who prioritize simplicity and self-contained output over the full feature set of Visual Studio or the dotnet CLI.
Development activity shows consistent engagement with platform support expansion, as evidenced by ongoing work on musl-based Linux support beyond the currently supported glibc and bionic variants. The project maintains a split codebase between the main repository and a regularly updated fork of dotnet/runtime that contains bflat-specific changes, indicating active synchronization with upstream .NET developments. Binary releases are distributed through multiple channels including GitHub releases and Windows package managers, suggesting attention to accessibility for different user bases.