Sharp Runtime

Sharp Runtime
Website https://sharpruntime.openeggbert.com
Programming language C++
C++ standard C++23
Licence MIT
Based on Partly derived from .NET Runtime (MIT, © .NET Foundation)
Used by CNA

Sharp Runtime is a C++ reimplementation of a small C#/.NET runtime subset, mainly used by CNA and game ports.

The goal is to provide a lightweight, .NET-inspired foundation layer for C++ projects, with a focus on familiar API design (System::*-like namespaces), clean and modern C++ implementation, and compatibility with higher-level frameworks like CNA.

Sharp Runtime is not a full .NET runtime or CLR implementation. It is a pragmatic subset designed for use in native C++ applications.

Role in the stack

Sharp Runtime  (System::* types, exceptions, events, delegates)
      └── CNA  (XNA-like API)
            └── Mobile Eggbert (C++), Galaxy Eggbert, MeshCraft, ...

Goals

Attribution

Sharp Runtime is partly derived from the .NET runtime (dotnet/runtime, MIT License, © .NET Foundation and Contributors). The public API design of System::* types — class names, method signatures, namespace structure, and enum values — is based on the .NET standard library. Some algorithmic implementations (number formatting, date/time arithmetic, Unicode handling) are informed by or translated from the dotnet/runtime source code. The C++ implementation is original work by Robert Vokac and contributors.

Implementation status

Each class or function is annotated with one of these statuses in Doxygen comments:

Status Meaning
Todo Not implemented yet
Stub Skeleton only, returns placeholder or fails
Partial Partially implemented, may be incomplete
Implemented Functionally complete
Verified Validated against expected .NET behavior

Build

cmake -S . -B build
cmake --build build

Scope

Sharp Runtime intentionally does not aim to implement: the CLR (Common Language Runtime), JIT compilation, or full .NET standard compatibility. It focuses on a practical subset useful for native development.