# bflattened/bflat

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/bflattened-bflat).**

3,957 stars · 115 forks · C# · AGPL-3.0

## Links

- GitHub: https://github.com/bflattened/bflat
- awesome-repositories: https://awesome-repositories.com/repository/bflattened-bflat.md

## Description

bflat is a native compiler and ahead-of-time binary generator for C#. It transforms source code into self-contained native executables and machine code that run without requiring a separate runtime environment.

The project features a cross-platform native toolchain capable of generating binaries for multiple operating systems and architectures from a single environment. It includes a mechanism for exporting C# logic as shared native libraries via a foreign function interface for integration with other programming languages.

To support resource-constrained environments, it provides a binary optimizer that reduces executable size by stripping reflection data, globalization metadata, and stack trace information. It also allows for the selection of different standard library depths to balance feature richness against the final binary footprint.

The toolchain supports system-level debugging, enabling the use of native debuggers to set breakpoints and inspect variables directly within the compiled machine code.

## Tags

### Mobile Development

- [Native Executable Compilers](https://awesome-repositories.com/f/mobile-development/red-packet-automation/native-executable-compilers.md) — Transforms C# source code into standalone native binary executables that run without a separate runtime. ([source](https://github.com/bflattened/bflat#readme))

### Development Tools & Productivity

- [Cross-Platform Toolchains](https://awesome-repositories.com/f/development-tools-productivity/cross-platform-toolchains.md) — Provides an integrated suite of utilities for building and debugging native binaries across diverse architectures.
- [Self-Contained Executables](https://awesome-repositories.com/f/development-tools-productivity/self-contained-executables.md) — Produces single binaries that bundle all necessary runtime logic and dependencies to eliminate external requirements.
- [Minimal Runtime Footprints](https://awesome-repositories.com/f/development-tools-productivity/application-installers/installation-footprint-reducers/runtime-footprint-reducers/minimal-runtime-footprints.md) — Achieves a small binary size and low memory usage by stripping reflection and globalization data.
- [Binary Metadata Stripping](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/debugging-diagnostics/debugging-inspection-tools/debugging-and-inspection-tools/runtime-debugging/debug-symbol-stripping/binary-metadata-stripping.md) — Reduces executable size by stripping reflection data, globalization strings, and stack trace metadata.

### DevOps & Infrastructure

- [Cross-Platform Deployment Targets](https://awesome-repositories.com/f/devops-infrastructure/cross-platform-deployment-targets.md) — Supports compiling and running C# applications across diverse operating systems and hardware architectures.

### Programming Languages & Runtimes

- [Cross-Platform Compilers](https://awesome-repositories.com/f/programming-languages-runtimes/cross-platform-compilers.md) — Provides a compiler capable of targeting multiple operating systems and processor architectures from C# source code.
- [Machine Code Generators](https://awesome-repositories.com/f/programming-languages-runtimes/machine-code-generators.md) — Translates intermediate representations directly into hardware-specific machine instructions for high performance.
- [Native C# Compilers](https://awesome-repositories.com/f/programming-languages-runtimes/native-c-compilers.md) — Transforms C# source code into self-contained native executables without requiring a separate runtime environment.
- [AOT Compiled Binaries](https://awesome-repositories.com/f/programming-languages-runtimes/native-runtime-execution/aot-compiled-binaries.md) — Produces ahead-of-time compiled binaries that eliminate runtime startup overhead and external dependencies.
- [Binary Size Optimizations](https://awesome-repositories.com/f/programming-languages-runtimes/binary-size-optimizations.md) — Provides a utility to reduce executable size by stripping reflection data, globalization metadata, and stack trace information.
- [Cross-Language Library Development](https://awesome-repositories.com/f/programming-languages-runtimes/cross-language-library-development.md) — Develops core C# logic exposed as native libraries for use across multiple target programming languages.
- [Foreign Function Interfaces](https://awesome-repositories.com/f/programming-languages-runtimes/language-interoperability/foreign-function-interfaces.md) — Implements binding layers that enable communication between C# logic and other programming languages via native libraries.
- [Native Library Integrations](https://awesome-repositories.com/f/programming-languages-runtimes/language-interoperability/foreign-function-interfaces/native-library-integrations.md) — Creates native libraries that expose C# functions via a foreign function interface for cross-language integration. ([source](https://github.com/bflattened/bflat/blob/master/README.md))
- [Runtime Library Selection](https://awesome-repositories.com/f/programming-languages-runtimes/language-interoperability/native-c-interoperability/c-runtimes/runtime-library-selection.md) — Offers a mechanism to choose between comprehensive or minimal library implementations for resource-constrained environments. ([source](https://github.com/bflattened/bflat#readme))
- [Standard Library Size Optimizations](https://awesome-repositories.com/f/programming-languages-runtimes/performance-optimization-libraries/standard-library-size-optimizations.md) — Provides options to configure the standard library depth to minimize the final compiled binary size. ([source](https://github.com/bflattened/bflat/blob/master/README.md))

### Software Engineering & Architecture

- [Binary Size Optimizations](https://awesome-repositories.com/f/software-engineering-architecture/binary-size-optimizations.md) — Reduces the executable footprint by stripping reflection, stack trace data, and exception messages to lower total memory usage. ([source](https://github.com/bflattened/bflat#readme))
- [Footprint-Based Library Selection](https://awesome-repositories.com/f/software-engineering-architecture/library-conflict-resolution/footprint-based-library-selection.md) — Allows selection between full feature sets and minimal primitive libraries to optimize the binary footprint.
- [Dynamic Library Exports](https://awesome-repositories.com/f/software-engineering-architecture/shared-library-integrations/dynamic-library-exports.md) — Exports C# logic as shared native libraries for consumption by other programming languages.
