Cesium is a fully managed C compiler for CLI platform (.NET).
What? Cesium compiles standard C source code to a .NET assembly. No unmanaged/mixed mode (a-lá C++/CLI) code is expected to be generated; everything is fully managed (but unsafe).
Why? C programs are very useful in the modern world, and solve practical tasks. At the same time, deploying C code alongside .NET code may be tricky (especially if your application supports multiple platforms). Cesium is designed to resolve the problems of C code deployment, and lift it to the managed state (so it is crossplatform in the same way the underlying CIL code it is compiled to).
- C17 parser: just started
- CIL code generator: just started
- PDB support: none
- C preprocessor: none
- .NET SDK: none
- Standard library: none
$ dotnet run --project Cesium.Compiler -- <path to the input .c file> <path to the output assembly>
For example, this will generate an assembly executable by .NET 6, .NET Framework, or Mono:
$ dotnet run --project Cesium.Compiler -- Cesium.Samples/minimal.c out.exe
$ dotnet ./out.exe # run with .NET 6
$ ./out.exe # only on Windows, run with .NET Framework
$ mono ./out.exe # run with Mono