• Stars
    star
    340
  • Rank 124,317 (Top 3 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 3 years ago
  • Updated 4 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#
637
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
51
star
7

Generaptor

GitHub Actions configuration generator
F#
46
star
8

TruePath

File path abstraction library for .NET.
C#
41
star
9

Indihiang

Web log analyzing tool
C#
25
star
10

fornever.me

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

ProcessDoctor

Cross-platform process monitoring and control software.
C#
22
star
12

awesome-old-game-remakes

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

CyclopsChat

WPF-based XMPP chat application.
C#
20
star
14

bloodmasters

Arcade, oldschool multiplayer and bloodshed.
C#
20
star
15

O21

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

PascalABC.NET.SDK

MSBuild SDK for PascalABC.NET
C#
17
star
17

andivionian-status-classifier

Software project status classifier.
16
star
18

Fenrir

Git tool in F#
F#
16
star
19

Oddities

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

praefectus

Programmable organizer application suite.
F#
15
star
21

Megadeth

A Telegram moderation solution
C#
14
star
22

overtone

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

Todosaurus

IntelliJ Plaform plugin to manage TODO comments in the code.
Kotlin
12
star
24

ChangelogAutomation

A handy tool to automate changelog processing in CI.
C#
12
star
25

omea

The Integrated Information Environment
C#
12
star
26

skalarprodukt

Experimental multidimensional arrays for F#
F#
11
star
27

Fabricator

The sharpest devops tool.
F#
10
star
28

Vacuum

Temporary file cleanup tool
F#
9
star
29

cil-mode

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

talk-lens

Talk about the LENS programming language.
HTML
7
star
31

SvgBuild

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

talk-marshal-unsafe

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

ChangelogAutomation.action

GitHub action to process changelog file.
JavaScript
6
star
34

rider-plugin-template

JetBrains Rider plugin template
Kotlin
6
star
35

artwork

Some things I draw myself.
F#
6
star
36

ProcessWatcher

A process auditing tool for Windows.
C#
6
star
37

Sound.Generator

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

nightwatch

Stays alert while you sleep.
F#
6
star
39

warcraft-2000-nuclear-epidemic

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

intellij-updater

A GitHub Action to auto-update IntelliJ Platform version for IntelliJ-based IDE plugins
F#
6
star
41

rss-filter

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

git-submerge

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

platonus

Simple Markov-network text generator.
Scala
5
star
44

adamantium

A compiler for CLR.
TypeScript
5
star
45

dotnet-licenses

Set of tooling to maintain software license information in published packages.
F#
5
star
46

OPOS-CCO

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

Smith

A modern Matrix client.
C#
4
star
48

interclient

A legacy connector for InterBase.
Java
4
star
49

old-mixer-tales

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

file-link-executor

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

strafesharp

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

Gyges

Tyrian rethinked.
F#
4
star
53

BetterFuck

Brainfuck language compiler for CLR.
C#
4
star
54

pascalabcnet.cecil

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

taskomatic

Import GitHub issues to TaskWarrior
C#
4
star
56

hell-api

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

malco

Malco programming language
C
4
star
58

1969

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

pocketeer

Pocket archival tool
F#
3
star
60

SocketTestLab

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

env-exporter

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

loglist-frontend

Modern frontend for LogList
JavaScript
3
star
63

wekan-to-taskwarrior

Import data from Wekan to Taskwarrior
PowerShell
3
star
64

mathtexdotnet

Ol' good MathTeX.NET
C#
3
star
65

Tantalum

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

Mandelbrot

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

net-core-slides

Talk about .NET Core in Russian
HTML
3
star
68

doom-start-scripts

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

checktimer

Simple manual time tracking application
Scala
3
star
70

Cerebellum

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

Numbers

CPU-based combination solver
F#
3
star
72

avalonia-pascalabc-net-showcase

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

cthulhu-bot

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

PoshConsole

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

TankDriver

Simple game about tanks.
C#
3
star
76

Hammerfest

C&C3 Modernization Project
C#
2
star
77

fstar-tutorial

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

Lagger

A program to lag selected process on Windows.
C#
2
star
79

modern-programming

Talk about modern programming in Russian.
HTML
2
star
80

w3gparser

WarCraft III replay analyzer toolkit
C#
2
star
81

dotfiles

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

EvilPlanner

A small lab application.
F#
2
star
83

wine-ng-mt_netcwmp

C
2
star
84

yog-sothoth

.NET-based XMPP logger
F#
2
star
85

git-basics

Talk about Git basics in Russian
HTML
2
star
86

GitWatcher

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

Technetium

Task management software
F#
2
star
88

cogitator

Simple but effective firewall for Windows
PowerShell
2
star
89

macrojson

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

SvnUtils

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

Umov.Csxcad

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

empty-repo-for-rexim-to-star

Empty repo for ForNeVeR to star
2
star
93

mithgolizer-miranda

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

WindowsDebuggerIssue

C++
2
star
95

eBomber

Bomberbot server written in Erlang.
Erlang
2
star
96

processor

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

FDTD-JAVA

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

OneNoteImporter

OneNote Importer by Donovan Lange
C#
2
star
99

SpySharp

Windows Forms introspection tool
F#
1
star
100

Huginn

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