Familiar APIs. Native C++.

Bring practical System.* APIs to C++23.

Sharp Runtime is a componentized native C++ implementation of a practical subset of .NET’s System.* surface—built for source ports that need familiar types and behavior without a managed runtime.

MIT licensed · CMake 3.20+ · C++23 · source facts pinned to 6d429559

CMakeLists.txt + main.cpp
# Select only what this app needs
set(SHARP_RUNTIME_COMPONENTS Console)
add_subdirectory(sharp-runtime)
target_link_libraries(hello PRIVATE
  SharpRuntime::Console)

#include <System/Console.hpp>

int main() {
  System::Console::WriteLine(
    "Native. Familiar. Focused.");
}
41physical CMake components
17,131current discovered test cases
C++23required language standard
MITopen-source license
Scope with boundaries

A compatibility library—not a CLR.

Sharp Runtime preserves useful API organization and porting patterns while remaining ordinary native C++. It does not execute managed assemblies and does not try to reproduce the managed execution environment.

What it provides
  • Native C++ types in familiar System::* namespaces
  • Core types, collections, text, JSON, XML, I/O, networking, numerics, threading, tasks, channels and more
  • Fine-grained CMake targets with transitive dependency closure
  • A pragmatic base for C#/.NET-to-C++ ports and CNA
What it does not provide
  • A CLR, JIT compiler, garbage collector, or managed assembly loader
  • General metadata reflection, DynamicInvoke, P/Invoke, remoting, or BinaryFormatter-style serialization
  • C# language async/await syntax in C++
  • TLS, certificates, SslStream, or wss:// transport
Verification

Evidence, not a vanity counter.

The pinned source registers 38 test executables and its latest measured full gate discovered and ran 17,131 GoogleTest cases: 17,123 passed, two skipped and six failed for documented network-related causes.

The repository also validates component boundaries, selective consumers, negative include/link fixtures, catalogue drift, integration behavior and Doxygen warning regressions.

Read the verification model
ValidatedComponent graph
41 physical modules and 92 declared direct production edges; no allow-list exceptions.
MeasuredCurrent suite shape
37 component executables plus one integration executable.
QualifiedFull gate
Five host-triggered Ping failures expose a real fallback gap; one IPv6-interface failure is environmental. Neither is hidden.
Portability

Platform claims carry evidence labels.

The current CI is Linux/Ubuntu. Other platforms have implementation and toolchain paths, but the website distinguishes source support, cross-compile evidence and runtime validation.

PlatformEvidence labelWhat that means
Linux / GCCPrimary native validationPush/PR jobs target Ubuntu; the measured full gate at this pin is qualified below rather than described as green.
Windows / MinGWHistorical cross-buildEarlier library-only All and Text.Json evidence exists; the selected pin was not rebuilt and GoogleTest did not run.
Windows / MSVCCompiler-limitedBuild logic exists, but native __int128-dependent numeric surfaces constrain current completeness.
macOS / Apple ClangDownstream build evidenceXcode 15.4 downstream builds drove fixes; no standalone full-suite result or current macOS CI job exists.
Emscripten / WebHistorical cross-buildEarlier library-only evidence exists; the selected pin was not rebuilt, DNS/native facilities are reduced, and no browser suite ran.
AndroidIntegration pathStorage can consume parent-provided SDL3; this audit did not run a device suite.
Platform matrix and caveats
Ecosystem

The System.* layer under CNA.

CNA, the sibling C++23 reimplementation of the XNA 4.0 API, builds on Sharp Runtime for familiar .NET base-library patterns. CNA owns the game framework; Sharp Runtime stays focused on the System.* compatibility layer.

How CNA integrates it
Start a path

From evaluation to contribution.