• Stars
    star
    316
  • Rank 127,523 (Top 3 %)
  • Language
    C#
  • License
    MIT License
  • Created over 2 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

C compiler for the CLI platform

Cesium Status Enfer

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 generated; everything is fully managed (but may be 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 cross-platform in the same way as the underlying CIL code it is compiled to).

Implementation Status

TL;DR: is it ready for use?

Unfortunately, not yet. You won't be able to use Cesium for anything useful today. Probably, you'll be able to start after the next milestone is implemented. Stay tuned!

Sneak Peek

Currently, Cesium is able to compile a "Hello, world" C17 example to a .NET assembly:

#include <stdio.h>

int main(int argc, char *argv[])
{
    puts("Hello, world!");
    return 42;
}

The next milestone is #61: sha1collisiondetection, which is 80% complete (note that the progress estimation is preliminary and may be changed in either direction at any moment).

Documentation

Usage

$ dotnet run --project Cesium.Compiler -- <path to the input .c file> --out <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 out.exe
$ dotnet ./out.exe # run with .NET 6
$ ./out.exe # only on Windows, run with .NET Framework
$ mono ./out.exe # run with Mono

Optional Parameters

  • --framework <framework>: specifies the target framework, defaults to Net
    • NetFramework for .NET Framework
    • NetStandard for .NET Standard
    • Net for .NET 5+
  • --arch <architecture-set>: specifies the target architecture set, defaults to Dynamic. Possible values are:
    • Dynamic (machine-independent),
    • Bit32 (for 32-bit CPUs),
    • Bit64 (for 64-bit CPUs).
  • --modulekind <moduleKind>: specifies the output module kind; by default, it is autodetected from the output file extension
    • Dll: gets detected from a .dll extension
    • Console: gets detected from an .exe extension
    • Windows: doesn't get detected, so it's only possible to select manually
    • NetModule: is a rudiment from Cecil, not supported

Implementation Dashboard

Have a question? Welcome to the discussions section!

Looking to contribute? Check open issues with the "help-wanted" label. Cesium is a big project which lives thanks to its contributors.

Not sure where to contribute? Check open issues with the "good first issue" label.

Take a look at the contributor guide.

If you're interested in certain project areas, check the per-area issue labels:

More Repositories

1

xaml-math

A collection of .NET libraries for rendering mathematical formulae using the LaTeX typesetting style, for the WPF and Avalonia XAML-based frameworks
C#
601
star
2

AvaloniaRider

JetBrains Rider plugin for Avalonia development
Kotlin
375
star
3

ExtDiff

Compare documents using MS Word from the command line.
PowerShell
108
star
4

tdlib.native

Prebuilt binaries of TDLib distributed as a NuGet package.
PowerShell
95
star
5

ManagedSpy

Runtime introspect Windows Forms applications.
C++
77
star
6

msdn-delocalizer

Chrome and Firefox extension to force MSDN (and similar Microsoft documentation sites) to always use English locale.
TypeScript
49
star
7

Jabber-Net

[DEPRECATED] A modern fork of Jabber-Net
C#
36
star
8

Indihiang

Web log analyzing tool
C#
25
star
9

fornever.me

Friedrich von Never: Engineer, Programmer, Gentleman.
F#
25
star
10

awesome-old-game-remakes

A curated list of awesome open-source remakes of old games.
21
star
11

CyclopsChat

WPF-based XMPP chat application.
C#
18
star
12

O21

FOSS remake of U95, an old submarine arcade game from 1995.
F#
18
star
13

PascalABC.NET.SDK

MSBuild SDK for PascalABC.NET
C#
17
star
14

andivionian-status-classifier

Software project status classifier.
16
star
15

Fenrir

Git tool in F#
F#
16
star
16

bloodmasters

Arcade, oldschool multiplayer and bloodshed.
C#
16
star
17

Oddities

.NET libraries supporting several old and obscure data formats: DIB, MRB, NE, SHG, WinHelp.
C#
16
star
18

ProcessDoctor

Cross-platform process monitoring and control software.
C#
16
star
19

praefectus

Programmable organizer application suite.
F#
15
star
20

overtone

A modern FOSS remake of The Tone Rebellion.
F#
14
star
21

Megadeth

A Telegram moderation solution
C#
12
star
22

skalarprodukt

Experimental multidimensional arrays for F#
F#
11
star
23

ChangelogAutomation

A handy tool to automate changelog processing in CI.
C#
11
star
24

Fabricator

The sharpest devops tool.
F#
10
star
25

Vacuum

Temporary file cleanup tool
F#
9
star
26

cil-mode

Major emacs mode for editing Common Intermediate Language files.
Emacs Lisp
9
star
27

talk-lens

Talk about the LENS programming language.
HTML
7
star
28

SvgBuild

Managed tool set to render SVG images
C#
7
star
29

talk-marshal-unsafe

A talk (in Russian) about .NET marshaling and unsafe code.
HTML
6
star
30

ChangelogAutomation.action

GitHub action to process changelog file.
JavaScript
6
star
31

artwork

Some things I draw myself.
F#
6
star
32

rss-filter

Simple RSS filtering server not based on Play framework.
F#
6
star
33

Sound.Generator

Generate WAV files using Windows' TTS engine
C++
6
star
34

nightwatch

Stays alert while you sleep.
F#
6
star
35

git-submerge

Merge Git submodule into the main repo as if they've never been separate at all
Rust
5
star
36

platonus

Simple Markov-network text generator.
Scala
5
star
37

ProcessWatcher

A process auditing tool for Windows.
C#
5
star
38

adamantium

A compiler for CLR.
TypeScript
5
star
39

warcraft-2000-nuclear-epidemic

Sources of WarCraft 2000: Nuclear Epidemic, in the form they were made available by the developer.
C++
5
star
40

OPOS-CCO

OLE for Retail POS Common Control Objects with some patches.
C++
4
star
41

Smith

A modern Matrix client.
C#
4
star
42

old-mixer-tales

Wonderful stories of one strange old man.
Lua
4
star
43

interclient

A legacy connector for InterBase.
Java
4
star
44

file-link-executor

Starts executable files from the IntelliJ consoles.
Kotlin
4
star
45

strafesharp

.NET library and a support programs to control Corsair Strafe RGB keyboard
F#
4
star
46

Gyges

Tyrian rethinked.
F#
4
star
47

BetterFuck

Brainfuck language compiler for CLR.
C#
4
star
48

taskomatic

Import GitHub issues to TaskWarrior
C#
4
star
49

hell-api

Miranda IM managed plugin API adapter for .NET.
C#
4
star
50

malco

Malco programming language
C
4
star
51

1969

The Moon landing never happened, but we went to the Mars instead.
F#
4
star
52

wekan-to-taskwarrior

Import data from Wekan to Taskwarrior
PowerShell
3
star
53

SocketTestLab

Playing with sockets in .NET.
C#
3
star
54

env-exporter

Export computer's environment variables to a file.
PowerShell
3
star
55

loglist-frontend

Modern frontend for LogList
JavaScript
3
star
56

pocketeer

Pocket archival tool
F#
3
star
57

Tantalum

A simple algebraic computation system written in F#.
F#
3
star
58

doom-start-scripts

The stuff I keep forgetting all the time.
PowerShell
3
star
59

Mandelbrot

Application for real-time visualizing of Mandelbrot set.
C++
3
star
60

TankDriver

Simple game about tanks.
C#
3
star
61

net-core-slides

Talk about .NET Core in Russian
HTML
3
star
62

pascalabcnet.cecil

Mono.Cecil code generator for PascalABC.NET. See the issues section for details.
C#
3
star
63

Cerebellum

Server for sharing todo-notes between various clients.
Erlang
3
star
64

checktimer

Simple manual time tracking application
Scala
3
star
65

Numbers

CPU-based combination solver
F#
3
star
66

avalonia-pascalabc-net-showcase

Sample for AvaloniaUI written in PascalABC.NET
Pascal
3
star
67

mathtexdotnet

Ol' good MathTeX.NET
C#
3
star
68

cthulhu-bot

Just another XMPP bot using C++, boost and gloox technologies.
C++
3
star
69

PoshConsole

PoshConsole is a modern graphical PowerShell Console.
C#
3
star
70

Hammerfest

C&C3 Modernization Project
C#
2
star
71

fstar-tutorial

My solutions for the F* turorial
F*
2
star
72

modern-programming

Talk about modern programming in Russian.
HTML
2
star
73

w3gparser

WarCraft III replay analyzer toolkit
C#
2
star
74

dotfiles

My dotfiles and alike system entities.
Vim Script
2
star
75

EvilPlanner

A small lab application.
F#
2
star
76

wine-ng-mt_netcwmp

C
2
star
77

mithgolizer-miranda

Miganda NG plugin for banning the users.
C++
2
star
78

yog-sothoth

.NET-based XMPP logger
F#
2
star
79

git-basics

Talk about Git basics in Russian
HTML
2
star
80

GitWatcher

Powershell tool to watch directory changes and autocommit them to local git repository.
2
star
81

Technetium

Task management software
F#
2
star
82

cogitator

Simple but effective firewall for Windows
PowerShell
2
star
83

macrojson

Simple example of Scala macros and quasiquotes.
Scala
2
star
84

SvnUtils

PowerShell utility functions for the SVN version control.
PowerShell
2
star
85

Umov.Csxcad

CLI-based CSXCAD parser and writer.
F#
2
star
86

empty-repo-for-rexim-to-star

Empty repo for ForNeVeR to star
2
star
87

WindowsDebuggerIssue

C++
2
star
88

eBomber

Bomberbot server written in Erlang.
Erlang
2
star
89

processor

Simplified Windows process manager written in Rust.
Rust
2
star
90

FDTD-JAVA

Stephen Kirkup implementation of FDTD simulation in Java.
Java
2
star
91

SpySharp

Windows Forms introspection tool
F#
1
star
92

Huginn

It will be a graphical VCS client.
C++
1
star
93

Summatorium

A small benchmark for the good of all of us except the ones who are dead
C#
1
star
94

talk-javascriptservices

My talk about ASP.NET Core and JavaScriptServices.
HTML
1
star
95

PsJira

PowerShell JIRA client.
PowerShell
1
star
96

robocode-sniper

Simple bot for Robocode
Java
1
star
97

ps-path

PowerShell path extensions.
PowerShell
1
star
98

idea-conan-plugin

Conan C/C++ package manager plugin for IDEA-based IDEs
Kotlin
1
star
99

ML2Calculator

A notice from the past.
Pascal
1
star
100

fgitterc

Integrate gitter with IRC.
Frege
1
star