{"id":15060933,"url":"https://github.com/kekyo/il2c","last_synced_at":"2025-04-12T14:57:47.609Z","repository":{"id":25267730,"uuid":"103600670","full_name":"kekyo/IL2C","owner":"kekyo","description":"IL2C - A translator for ECMA-335 CIL/MSIL to C language.","archived":false,"fork":false,"pushed_at":"2022-06-19T14:05:38.000Z","size":25582,"stargazers_count":417,"open_issues_count":42,"forks_count":36,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-12T14:57:37.169Z","etag":null,"topics":["aot","arduino","c","cil","csharp","dotnet","ecma335","fsharp","intermediate-language","msil","systems-programming","translator","transpiler","uefi","wdm"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kekyo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-15T01:42:59.000Z","updated_at":"2025-03-28T02:17:01.000Z","dependencies_parsed_at":"2022-07-12T02:49:51.741Z","dependency_job_id":null,"html_url":"https://github.com/kekyo/IL2C","commit_stats":null,"previous_names":[],"tags_count":105,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kekyo%2FIL2C","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kekyo%2FIL2C/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kekyo%2FIL2C/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kekyo%2FIL2C/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kekyo","download_url":"https://codeload.github.com/kekyo/IL2C/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586249,"owners_count":21128997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aot","arduino","c","cil","csharp","dotnet","ecma335","fsharp","intermediate-language","msil","systems-programming","translator","transpiler","uefi","wdm"],"created_at":"2024-09-24T23:06:52.179Z","updated_at":"2025-04-12T14:57:47.590Z","avatar_url":"https://github.com/kekyo.png","language":"C#","readme":"# IL2C - A translator for ECMA-335 CIL/MSIL to C language.\n\n![Intermediate language everywhere!](images/banner.png)\n\n## What's this?\n\n* IL2C is a translator (transpiler) of ECMA-335 CIL/MSIL to C language.\n\n* We're aiming for:\n  * **Better predictability of runtime costs**  \n  Better human readability of C source code translated by IL2C.\n  * **Very tiny footprint requirements**  \n  We're thinking about how to fit from large system with many resources to tiny embedded system. (KB order for the non-OSes system)\n  * **Better code/runtime portability**  \n  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.)\n  * **Better interoperabilities for existed C libraries**  \n  You can use the standard .NET interop technics (like P/Invoke.)\n  * **Containing seamless building systems for major C toolkits**  \n  for example: CMake system, Arduino IDE, VC++ ...\n\n## Simple hello-world like code\n\nOriginal C# source code:\n\n```csharp\npublic static class HelloWorld\n{\n    public static void Main()\n    {\n        Console.WriteLine(\"Hello world with IL2C!\");\n    }\n}\n```\n\nTranslated to C source code (all comments are stripped):\n\n```c\nIL2C_CONST_STRING(string0__, L\"Hello world with IL2C!\");\n\nvoid HelloWorld_Main()\n{\n    struct\n    {\n        const IL2C_EXECUTION_FRAME* pNext__;\n        const uint16_t objRefCount__;\n        const uint16_t valueCount__;\n        System_String* stack0_0__;\n    } frame__ = { NULL, 1, 0 };\n    il2c_link_execution_frame(\u0026frame__);\n\n    frame__.stack0_0__ = string0__;\n    System_Console_WriteLine_10(frame__.stack0_0__);\n    il2c_unlink_execution_frame(\u0026frame__);\n    return;\n}\n```\n\n[View with comments / other sample translation results (contain complex results)](docs/sample-translation-results.md)\n\n## Getting started\n\nIL2C current status is **experimental**, read a simple [\"Getting started\"](docs/getting-started.md) for first step.\n\nIf you need understanding deep knowledge for IL2C, see [\"Inside IL2C\"](docs/inside-il2c.md) .\n\n## Project status\n\nFollowing lists are auto-generated by unit test.\n\n* [Supported IL opcodes list](docs/supported-opcodes.md)\n\n* [Supported basic types](docs/supported-basic-types.md)\n\n* [Supported runtime system features](docs/supported-runtime-system-features.md)\n\n[Supported features (old)](docs/supported-features.md)\n\n## Packages\n\n| Packages | master | devel |\n|:---|:---|:---|\n| IL2C.Build | [![NuGet IL2C.Build](https://img.shields.io/nuget/v/IL2C.Build.svg?style=flat)](https://www.nuget.org/packages/IL2C.Build) | [![MyGet IL2C.Build](https://img.shields.io/myget/il2c/v/IL2C.Core.svg?style=flat\u0026label=myget)](https://www.myget.org/feed/il2c/package/nuget/IL2C.Build) |\n| IL2C.Interop | [![NuGet IL2C.Interop](https://img.shields.io/nuget/v/IL2C.Interop.svg?style=flat)](https://www.nuget.org/packages/IL2C.Interop) | [![MyGet IL2C.Interop](https://img.shields.io/myget/il2c/v/IL2C.Interop.svg?style=flat\u0026label=myget)](https://www.myget.org/feed/il2c/package/nuget/IL2C.Interop) |\n| IL2C.Core | [![NuGet IL2C.Core](https://img.shields.io/nuget/v/IL2C.Core.svg?style=flat)](https://www.nuget.org/packages/IL2C.Core) | [![MyGet IL2C.Core](https://img.shields.io/myget/il2c/v/IL2C.Core.svg?style=flat\u0026label=myget)](https://www.myget.org/feed/il2c/package/nuget/IL2C.Core) |\n| IL2C.Runtime | [![NuGet IL2C.Runtime](https://img.shields.io/nuget/v/IL2C.Runtime.svg?style=flat)](https://www.nuget.org/packages/IL2C.Runtime) | [![MyGet IL2C.Runtime](https://img.shields.io/myget/il2c/v/IL2C.Runtime.svg?style=flat\u0026label=myget)](https://www.myget.org/feed/il2c/package/nuget/IL2C.Runtime) |\n| IL2C.Runtime.msvc | [![NuGet IL2C.Runtime.msvc](https://img.shields.io/nuget/v/IL2C.Runtime.msvc.svg?style=flat)](https://www.nuget.org/packages/IL2C.Runtime.msvc) | [![MyGet IL2C.Runtime.msvc](https://img.shields.io/myget/il2c/v/IL2C.Runtime.msvc.svg?style=flat\u0026label=myget)](https://www.myget.org/feed/il2c/package/nuget/IL2C.Runtime.msvc) |\n| IL2C.Runtime.Arduino | [(Constructing)](https://github.com/kekyo/IL2C.Runtime.Arduino) | [(Constructing)](https://github.com/kekyo/IL2C.Runtime.Arduino) |\n\n## Build status\n\n|Configuration|master|\n|:--|:--|\n|Publish|[![Azure pipelines (.NET 4.5 / .NET Core 2.0)](https://kekyo.visualstudio.com/IL2C/_apis/build/status/IL2C-publish-master)](https://kekyo.visualstudio.com/IL2C/_build?definitionId=6)\n|Debug|[![Azure pipelines (.NET 4.5 / .NET Core 2.0)](https://kekyo.visualstudio.com/IL2C/_apis/build/status/IL2C-master-Debug) ![Azure pipelines tests](https://img.shields.io/azure-devops/tests/kekyo/IL2C/2.svg)](https://kekyo.visualstudio.com/IL2C/_build?definitionId=2)\n|Release|[![Azure pipelines (.NET 4.5 / .NET Core 2.0)](https://kekyo.visualstudio.com/IL2C/_apis/build/status/IL2C-master-Release) ![Azure pipelines tests](https://img.shields.io/azure-devops/tests/kekyo/IL2C/3.svg)](https://kekyo.visualstudio.com/IL2C/_build?definitionId=3)\n\n|Configuration|devel|\n|:--|:--|\n|Publish|[![Azure pipelines (.NET 4.5 / .NET Core 2.0)](https://kekyo.visualstudio.com/IL2C/_apis/build/status/IL2C-publish-devel)](https://kekyo.visualstudio.com/IL2C/_build?definitionId=6)\n|Debug|[![Azure pipelines (.NET 4.5 / .NET Core 2.0)](https://kekyo.visualstudio.com/IL2C/_apis/build/status/IL2C-devel-Debug) ![Azure pipelines tests](https://img.shields.io/azure-devops/tests/kekyo/IL2C/4.svg)](https://kekyo.visualstudio.com/IL2C/_build?definitionId=4)\u003cbr\u003e![Build Stats](https://buildstats.info/azurepipelines/chart/kekyo/IL2C/4?includeBuildsFromPullRequest=false)|\n|Release|[![Azure pipelines (.NET 4.5 / .NET Core 2.0)](https://kekyo.visualstudio.com/IL2C/_apis/build/status/IL2C-devel-Release) ![Azure pipelines tests](https://img.shields.io/azure-devops/tests/kekyo/IL2C/5.svg)](https://kekyo.visualstudio.com/IL2C/_build?definitionId=5)\u003cbr\u003e![Build Stats](https://buildstats.info/azurepipelines/chart/kekyo/IL2C/5?includeBuildsFromPullRequest=false)|\n\n## License\n\nUnder Apache v2.\n\n## Related information\n\n* Slide: [Making archive IL2C](https://www.slideshare.net/kekyo/making-archive-il2c-655-dotnet600-2018)\n\n  * **Covers overall information about internal IL2C.**\n  * #6-52 session in [dotNET 600 2018](https://centerclr.connpass.com/event/101479/) conference.\n\n* Slide: [Write common, run anywhere](https://www.slideshare.net/kekyo/write-common-run-anywhere)\n  * #6-51 session in [dotNET 600 2017](https://centerclr.connpass.com/event/71414/)\n conference\n  * [Session video (Japanese)](http://bit.ly/2DiaoKZ)\n  \n* Polish notation calculator:  [Minimum, but useful impls for \"Win32\", \"UEFI\" and \"M5Stack(ESP32)\"](samples/Calculator)\n  ![Calculator.M5Stack](images/Calculator.M5Stack.jpg)\n\n* Slide: [How to make the calculator / Making archive IL2C](https://www.slideshare.net/kekyo/how-to-make-the-calculator)\n  * #6-52 session in [.NET Fringe Japan 2018](https://dotnetfringe-japan.connpass.com/event/74536/)\n\n* Slide: [Making archive IL2C](https://www.slideshare.net/kekyo/mvp-summit-f-meetup-making-archive-il2c-653)\n  * #6-53 session in [MVP Summit F# Meetup / SEATTLE F# USERS GROUP](https://www.meetup.com/en-US/FSharpSeattle/events/247905452/)\n\n* Slide: [Making archive IL2C](https://www.slideshare.net/kekyo/making-archive-il2c-654-at-mvp-summit-2018-vs-hackathon)\n  * #6-54 session in [Microsoft MVP Global Summit 2018](https://mvp.microsoft.com/en-us/Summit/Agenda)\n – VS HACKATHON\"\n\n* Session video (Japanese): [\"Making archive IL2C play list\"](http://bit.ly/2xtu4MH)\n  * \"How to create IL2C or a tool similar to IL2CPP? You see just the pure design process includes the concept.\"\n  * #1 session in [Center CLR #6](https://centerclr.connpass.com/)\n\n* Video letter (Japanese): [Tested IL2C on micro:bit and arduino platform](http://bit.ly/2xGFo9J)\n  ![Tested IL2C on micro:bit and arduino platform #8](images/microbit.jpg)\n\n* Session video (Japanese): [Making archive IL2C](http://bit.ly/2hI1jTb)\n  * #6-28 session in [.NET Conf 2017 in Tokyo Room B](https://csugjp.connpass.com/event/66004/)\n\n* Milestone 2+ informations (Japanese): [Extensive Xamarin - Xamaritans](http://bit.ly/2ycNVzW)\n  * included in the booklet \"Extensive Xamarin - Techbook Fest part 3\"\n\n## Photos of design process\n\n* #6-6: Near milestones\n\n  ![#6-6: Near milestones](images/IMG_20170917_194810.jpg)\n\n* #6-14: Data flow analysis\n\n  ![#6-14: Data flow analysis](images/IMG_20170926_225355.jpg)\n\n* Milestone 1: Test on VC++ and check how C compiler's optimizer works.\n\n  ![Milestone 1: Test on VC++ and check how C compiler's optimizer works](images/il2c1.png)\n\n* #6-48: How mark-and-sweep garbage collection works on a translated code.\n\n  ![#6-48: How mark-and-sweep garbage collection works on a translated code](images/IMG_20171130_200549.jpg)\n\n* How overload/override/virtual method symbol calculus work.\n\n  ![How overload/override/virtual method symbol calculus work](images/IMG_20181028_165314.jpg)\n  \n* How to translate exception handlers when combined the local unwind and global unwind.\n  * We are thinking about at [Center CLR Try! development meetup (11/10/2018, Japanese)](https://centerclr.connpass.com/event/107981/)\n\n  ![How to translate exception handlers when combined the local unwind and global unwind](images/IMG_20181110_181756.jpg)\n    \n* This is the strcuture graph for the exection-frame and exception-frame.\n\n  ![This is the strcuture graph for the exection-frame and exception-frame](images/IMG_20181112_120412.jpg)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkekyo%2Fil2c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkekyo%2Fil2c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkekyo%2Fil2c/lists"}