sharp-runtime Documentation
A C++23 static library reimplementing a practical subset of the .NET System.* namespace.
System::* API compatibility
so that ported C#/XNA game code compiles with minimal changes. It powers
CNA (C++ port of XNA 4.0) and mobile-eggbert.
Quick Start
# Clone the repository (with submodules)
git clone --recurse-submodules https://github.com/openeggbert/sharp-runtime.git
cd sharp-runtime
# Build
cmake -S . -B build
cmake --build build --parallel 4
# Run all tests
./build/SharpRuntimeTests
Explore the Documentation
Project Overview
What sharp-runtime is, its goals, status, and relationship to CNA.
Getting Started
How to build, run tests, and integrate sharp-runtime into your project.
Architecture
Runtime layers, namespace design, key architectural decisions.
C# Compatibility
Mapping table from C# constructs to C++ sharp-runtime equivalents.
Type System
Primitive types, Object base class, SharpRuntimeHelper.
Exceptions
Exception hierarchy, throwing patterns, C# to C++ mapping.
Strings
std::string usage, System::String helpers, StringBuilder.
I/O Subsystem
Stream, File, Directory, Compression, IsolatedStorage.
All Modules
Browse documentation for every subsystem and namespace.
Porting C# Code
Practical guide for porting C# classes to C++ using sharp-runtime.
Tutorials
Step-by-step guides for common tasks.
Known Limitations
What is not implemented, POSIX-only subsystems, known gaps.
Status Summary
| Metric | Value |
|---|---|
| Tests passing | 3132 (across 471 test suites) |
| Header coverage | ~408 / 449 (~91%) |
| C++ standard | C++23 |
| Build output | libSHARP_RUNTIME.a |
| Build system | CMake ≥ 3.20 |
| Primary platform | Linux / macOS |
| Additional platforms | Windows (partial), Android (SDL3), Emscripten (partial) |
| License | MIT |