• Stars
    star
    389
  • Rank 110,500 (Top 3 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated over 2 years ago

Reviews

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

Repository Details

IL2C - A translator for ECMA-335 CIL/MSIL to C language.

IL2C - A translator for ECMA-335 CIL/MSIL to C language.

Intermediate language everywhere!

What's this?

  • IL2C is a translator (transpiler) of ECMA-335 CIL/MSIL to C language.

  • We're aiming for:

    • Better predictability of runtime costs
      Better human readability of C source code translated by IL2C.
    • Very tiny footprint requirements
      We're thinking about how to fit from large system with many resources to tiny embedded system. (KB order for the non-OSes system)
    • Better code/runtime portability
      Minimum requirement is only C99 compiler. The runtime minimum requires only the heap, CAS instructions, (POSIX) signal and setjmp/longjmp. Additional better feature is threading API (Win32, pthreads and FreeRTOS.)
    • Better interoperabilities for existed C libraries
      You can use the standard .NET interop technics (like P/Invoke.)
    • Containing seamless building systems for major C toolkits
      for example: CMake system, Arduino IDE, VC++ ...

Simple hello-world like code

Original C# source code:

public static class HelloWorld
{
    public static void Main()
    {
        Console.WriteLine("Hello world with IL2C!");
    }
}

Translated to C source code (all comments are stripped):

IL2C_CONST_STRING(string0__, L"Hello world with IL2C!");

void HelloWorld_Main()
{
    struct
    {
        const IL2C_EXECUTION_FRAME* pNext__;
        const uint16_t objRefCount__;
        const uint16_t valueCount__;
        System_String* stack0_0__;
    } frame__ = { NULL, 1, 0 };
    il2c_link_execution_frame(&frame__);

    frame__.stack0_0__ = string0__;
    System_Console_WriteLine_10(frame__.stack0_0__);
    il2c_unlink_execution_frame(&frame__);
    return;
}

View with comments / other sample translation results (contain complex results)

Getting started

IL2C current status is experimental, read a simple "Getting started" for first step.

If you need understanding deep knowledge for IL2C, see "Inside IL2C" .

Project status

Following lists are auto-generated by unit test.

Supported features (old)

Packages

Packages master devel
IL2C.Build NuGet IL2C.Build MyGet IL2C.Build
IL2C.Interop NuGet IL2C.Interop MyGet IL2C.Interop
IL2C.Core NuGet IL2C.Core MyGet IL2C.Core
IL2C.Runtime NuGet IL2C.Runtime MyGet IL2C.Runtime
IL2C.Runtime.msvc NuGet IL2C.Runtime.msvc MyGet IL2C.Runtime.msvc
IL2C.Runtime.Arduino (Constructing) (Constructing)

Build status

Configuration master
Publish Azure pipelines (.NET 4.5 / .NET Core 2.0)
Debug Azure pipelines (.NET 4.5 / .NET Core 2.0) Azure pipelines tests
Release Azure pipelines (.NET 4.5 / .NET Core 2.0) Azure pipelines tests
Configuration devel
Publish Azure pipelines (.NET 4.5 / .NET Core 2.0)
Debug Azure pipelines (.NET 4.5 / .NET Core 2.0) Azure pipelines tests
Build Stats
Release Azure pipelines (.NET 4.5 / .NET Core 2.0) Azure pipelines tests
Build Stats

License

Under Apache v2.

Related information

Photos of design process

  • #6-6: Near milestones

    #6-6: Near milestones

  • #6-14: Data flow analysis

    #6-14: Data flow analysis

  • Milestone 1: Test on VC++ and check how C compiler's optimizer works.

    Milestone 1: Test on VC++ and check how C compiler's optimizer works

  • #6-48: How mark-and-sweep garbage collection works on a translated code.

    #6-48: How mark-and-sweep garbage collection works on a translated code

  • How overload/override/virtual method symbol calculus work.

    How overload/override/virtual method symbol calculus work

  • How to translate exception handlers when combined the local unwind and global unwind.

    How to translate exception handlers when combined the local unwind and global unwind

  • This is the strcuture graph for the exection-frame and exception-frame.

    This is the strcuture graph for the exection-frame and exception-frame

More Repositories

1

Epoxy

An independent flexible XAML MVVM library for .NET
C#
160
star
2

FSharp.Control.FusionTasks

F# Async workflow <--> .NET Task/ValueTask easy seamless interoperability library.
F#
158
star
3

FlashCap

Independent camera capture library on .NET/.NET Core and .NET Framework.
C#
130
star
4

GitReader

Lightweight Git local repository traversal library for .NET/.NET Core/.NET Framework.
C#
54
star
5

MeCab.DotNet

A Japanese morphological analysis engine for .NET, .NET Core and .NET Frameworks.
C#
45
star
6

RelaxVersioner

Git tag/branch based, full-automatic version generator for .NET.
C#
34
star
7

TypeInferencer

Algorithm W and Algorithm M in F#
F#
33
star
8

Microsoft.CodeAnalysis.ActivePatterns

F# Active pattern library for Roslyn Compiler Platform (C#, VB)
F#
29
star
9

fdk-aac-win32-builder

libfdk-aac for Windows binary builder
Shell
29
star
10

SkiaImageView

A control for easy way showing SkiaSharp-based image objects onto WPF/XF/.NET MAUI/Avalonia applications.
C#
20
star
11

OuternetExplorer

An old-style web browser stub, comes from Internet Explorer was genocided on Windows.
C
17
star
12

ILRepack.FullAuto

Full automatic ILRepack executor on .NET, .NET Core and .NET Framework environments.
C#
16
star
13

SynchContextSample

.NET Custom SynchronizationContext sample codes.
C#
13
star
14

PowerPlayZipper

An implementation of Lightning-Fast Zip file compression/decompression library on .NET.
C#
11
star
15

DupeNukem

WebView attachable full-duplex asynchronous interoperable independent messaging library between .NET and JavaScript.
C#
11
star
16

JsonStreamer

JSON Lines streaming serializer/deserializer on .NET and ASP.NET Core.
C#
10
star
17

ILCompose

Compose partially implementation both .NET language and IL assembler into a single assembly.
C#
10
star
18

BoostForArduino

boost library for Arduino
C++
10
star
19

CenterCLR.SgmlReader

SgmlReader is "SGML" markup language parser, and derived from System.Xml.XmlReader in .NET CLR. (Portable class library version)
C#
8
star
20

CenterCLR.SushiRotator

SushiRotator - A reason for aborted working
C#
8
star
21

EaglePanelizer

EaglePanelizer - EAGLE CAD artwork panelizer
C#
7
star
22

Lepracaun

Lepracaun - Varies of .NET Synchronization Context.
C#
7
star
23

TortoiseMergePortable

Pseudo portable version TortoiseMerge based TortoiseSVN.
7
star
24

Nesp

A Lisp-like lightweight functional language on .NET
C#
7
star
25

decode2019_CM12

「de:code 2019」のセッション「CM12: .NET Core マルチプラットフォームの本質」に対応するサンプルコードと解説
C#
7
star
26

NamingFormatter

Can apply .NET format-string use named key-value arguments.
C#
6
star
27

chibias-cil

The specialized backend CIL assembler for chibicc-cil
C#
6
star
28

Spartan2Bone

The prototyping board for Xilinx Spartan-II FPGA processor.
Eagle
5
star
29

ILAsm.Managed

ILAsm.Managed - Portable managed Mono CIL assembler.
C#
5
star
30

OpenOCDonMinGW

OpenOCD binary builder on MSYS2/MinGW
Inno Setup
5
star
31

qemu-debian-mipsel-setup

Setup latest Debian mipsel on qemu malta.
Shell
4
star
32

MarkTheRipper

Fantastic faster generates static site comes from simply Markdowns.
C#
4
star
33

Fluorite

Simplest and fully-customizable RPC standalone infrastructure.
C#
4
star
34

ForestLog

A minimalist structuring logger interface, binds on Json Lines.
C#
3
star
35

Compat

Totally makes compatibility layer for .NET platforms.
C#
3
star
36

xpilot-ng

Imported from xpilot-ng https://sourceforge.net/projects/xpilot/
C
2
star
37

PedestrianController

American pedestrian signal controller running on ESP8266
C++
2
star
38

FlyFlint

Lightweight static O/R mapping builder at compile time.
C#
2
star
39

chatgpt-conversations

Personal conversations with ChatGPT (In Japanese)
2
star
40

NuGetBulkDownloader

Useful should to download all nuget packages from a nuget repository.
C#
2
star
41

dead-simple-electron-react-vite

Dead simple Electron & React & Vite project boilerplate/step by step installation.
TypeScript
2
star
42

esp-wrover-kit-lcd-demo

Minimal LCD demonstration on ESP-WROVER-KIT (ILI9341)
C++
2
star
43

VisualStudioProxyAdapter

Proxy adapter for Visual Studio (2012, 2013, 2015, 2017 and 2019), driven with HTTP_PROXY environment
C#
2
star
44

Favalon

An Interactive Shell Based on a Typed Lambda Calculus.
C#
2
star
45

Gaml

Gaml - GTK# on Xaml
C#
1
star
46

CSharpMonadic

C#でわかる、こわくないMonad https://www.slideshare.net/kekyo/cm-76399518
C#
1
star
47

VS2019Migration

Visual Studio 2019 Migration samples (C#) at Visual Studio 2019 Launch in Nagoya
C#
1
star
48

FSharp.Control.Tasks.Experimental

F# async computation infrastructure prove code
F#
1
star
49

CenterCLR.ExaSerializers

A lightning fast & lightweight simple binary serializer for .NET
C#
1
star
50

CenterCLR.Epoxy

Epoxy - A simplism MVVM assister library.
C#
1
star
51

PGA44DIP44

PGA44 to DIP44 socket PCB project using EAGLE CAD
Eagle
1
star
52

ExtremeFeedbackDevice

Extreme feedback device (XFD) on ESP8266
C++
1
star
53

kekyo

Functional runtime engineer. F#, IL, metaprogramming. Microsoft MVP for DevTech. Bicycle rider.
1
star
54

CenterCLR.XorRandomGenerator

Random number generator by xor-shift calculation
C#
1
star
55

gcc-toolchain

gcc cross toolchain builder on MSYS2/MinGW
Shell
1
star
56

tsunami-udp

Imported Tsunami UDP protocol from latest release tsunami-v1.1-cvsbuild42
C
1
star
57

future-promise

future-promise implements at C++ from scratch
C++
1
star
58

GACWrap

This implements managed wrappers to GAC (Windows Global Assembly Cache) API Interfaces, written by Junfeng Zhang.
C#
1
star
59

JenkinsBuildNotifier

Windows notification client, connected to Jenkins.
C#
1
star