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
# 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.");
}
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.
- 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
- A CLR, JIT compiler, garbage collector, or managed assembly loader
- General metadata reflection,
DynamicInvoke, P/Invoke, remoting, or BinaryFormatter-style serialization - C# language
async/awaitsyntax in C++ - TLS, certificates,
SslStream, orwss://transport
Use one focused surface—or the complete runtime.
Each physical component owns its public headers, implementation, tests and declared dependencies. Request direct needs; CMake enables the dependency closure.
Core & collections
Object and Type, strings and wrappers, arrays and memory, delegates, exceptions, generic, concurrent and observable collections.
DataText, JSON & XML
Encoding and formatting, StringBuilder, regex, nlohmann-backed JSON, tinyxml2-backed XML and LINQ-style XML.
SystemsI/O & storage
Streams, files and directories, compression, ZIP, hashing, isolated storage and platform storage paths.
ConnectivityNetworking
DNS, addresses, sockets, HTTP, headers, HTTP JSON, MIME, network information and WebSockets—with explicit TLS boundaries.
ConcurrencyThreading & tasks
Threads, synchronization, cancellation, thread pool, tasks, continuations, channels and timers using native C++ machinery.
ComputationNumerics & globalization
Vectors, matrices, quaternion, BigInteger, numeric wrappers, culture data, parsing and formatting—with compiler caveats documented.
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 model41 physical modules and 92 declared direct production edges; no allow-list exceptions.
37 component executables plus one integration executable.
Five host-triggered Ping failures expose a real fallback gap; one IPv6-interface failure is environmental. Neither is hidden.
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.
| Platform | Evidence label | What that means |
|---|---|---|
| Linux / GCC | Primary native validation | Push/PR jobs target Ubuntu; the measured full gate at this pin is qualified below rather than described as green. |
| Windows / MinGW | Historical cross-build | Earlier library-only All and Text.Json evidence exists; the selected pin was not rebuilt and GoogleTest did not run. |
| Windows / MSVC | Compiler-limited | Build logic exists, but native __int128-dependent numeric surfaces constrain current completeness. |
| macOS / Apple Clang | Downstream build evidence | Xcode 15.4 downstream builds drove fixes; no standalone full-suite result or current macOS CI job exists. |
| Emscripten / Web | Historical cross-build | Earlier library-only evidence exists; the selected pin was not rebuilt, DNS/native facilities are reduced, and no browser suite ran. |
| Android | Integration path | Storage can consume parent-provided SDL3; this audit did not run a device suite. |
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.