Project Overview

What sharp-runtime is, its purpose, goals, and current status.

What is sharp-runtime?

sharp-runtime is a C++23 static library that reimplements a practical subset of the .NET System.* namespace hierarchy. Its primary goal is to enable source-porting of C#/XNA game code to C++ with minimal changes, while providing a clean and modern C++ implementation that does not require the Common Language Runtime (CLR) or any managed runtime.

The public API closely mirrors .NET — class names, method signatures, and namespace structure all follow the .NET standard library conventions. The underlying C++ implementations use standard containers, RAII, and C++23 features.

⚠ Not a full .NET runtime
sharp-runtime does not implement the CLR, JIT compilation, garbage collection, reflection metadata, or full .NET standard compatibility. It is a pragmatic subset designed for practical use in native C++ game projects.

Main Purpose

sharp-runtime provides building blocks so that ported C#/XNA code can compile and run as native C++ with minimal changes. These building blocks include:

Relationship to Other Projects

ProjectRelationship
CNA C++ reimplementation of XNA 4.0. CNA is built on top of sharp-runtime. It depends on sharp-runtime for all System::* types, primitives, events, I/O, and threading.
mobile-eggbert C++ port of a Windows Phone game. Uses sharp-runtime for intcs/bytecs types, StringBuilder, TimeSpan, EventArgs, Random, and property macros.
dotnet/runtime Used as reference for API design only (MIT License). sharp-runtime's public API mirrors .NET class/method names. The C++ implementation is original work.

Main Visible Features

Supported Platforms

PlatformStatusNotes
LinuxDonePrimary development and CI platform
macOSDonePOSIX-compatible; same as Linux
WindowsPartialLinks ws2_32; POSIX-only subsystems need Win32 guards
AndroidPartialStoragePaths uses SDL3 when available; requires SDL3 from parent project
EmscriptenStubCompiles cleanly; some features throw PlatformNotSupportedException at runtime

Important Dependencies

DependencyLocationPurpose
ZLIBSystem (external)Required; used by GZipStream/DeflateStream
GoogleTestvendor/googletest/Test framework (git submodule)
nlohmann/jsonvendor/nlohmann/json.hppSystem::Text::Json implementation
tinyxml2vendor/tinyxml2/System::Xml::XmlReader / XmlWriter
minizvendor/miniz/System::IO::Compression::ZipArchive

Current Maturity / Status

As of the documentation date, sharp-runtime is in active development with approximately 91% header coverage and all planned subsystems implemented. The project is described (in NEXT.md) as being in a phase where "all planned subsystems implemented and tested (~96%+ header coverage)".

The status tracking system uses these values, written in Doxygen comments:

StatusMeaning
TodoNot implemented yet
StubSkeleton only — returns placeholder or throws
PartialPartially implemented, may have known gaps
ImplementedFunctionally complete
VerifiedValidated against expected .NET behavior

Design Philosophy