Chibil: A C compiler targeting .NET IL
Recorded: May 31, 2026, 5:01 p.m.
| Original | Summarized |
GitHub - MichalStrehovsky/chibil: C compiler for .NET · GitHub Skip to content Navigation Menu Toggle navigation
Sign in
Appearance settings PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub SparkBuild and deploy intelligent appsGitHub ModelsManage and compare promptsMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing Search or jump to... Search code, repositories, users, issues, pull requests...
Search Clear
Search syntax tips Provide feedback Include my email address so I can be contacted Cancel Submit feedback Saved searches
Name Query To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up
Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. Dismiss alert MichalStrehovsky chibil Public
Notifications
Fork
Star Code Issues Pull requests Actions Projects Security and quality Insights
Additional navigation options
Code Issues Pull requests Actions Projects Security and quality Insights
masterBranchesTagsGo to fileCodeOpen more actions menuFolders and filesNameNameLast commit messageLast commit dateLatest commit History105 Commits105 Commits.github/workflows.github/workflows chibilchibil crtcrt docsdocs samples/doomsamples/doom scenariosscenarios tests/Chibil.Teststests/Chibil.Tests toolstools .gitignore.gitignore .gitmodules.gitmodules README.mdREADME.md THIRD-PARTY-NOTICES.mdTHIRD-PARTY-NOTICES.md View all filesRepository files navigationREADMEChibil C compiler About C compiler for .NET Readme Uh oh! There was an error while loading. Please reload this page. Activity 27 0 0 Report repository Releases Packages
Uh oh! There was an error while loading. Please reload this page. Contributors Uh oh! There was an error while loading. Please reload this page. Languages C# C C++
Footer © 2026 GitHub, Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. |
The chibil project is a C compiler implemented in C sharp, derived from chibicc, which is specifically updated to target .NET Intermediate Language (MSIL). The compiler is designed to be functional enough to execute applications such as PureDOOM, establishing a foundation for compiling C code within a .NET environment. The compilation pipeline involves the process of taking C source files and generating COFF OBJ files, which are made binary-compatible with OBJ files produced by the MSVC compiler when operating in /clr mode. These generated object files can then be linked using link.exe from Visual Studio to produce final executable files, offering flexibility in mixing and matching object files generated by chibil with those from C++/CLI. Debugging capabilities are supported within the framework; the system maintains functionality for line numbers and local variables, allowing users to step through the C code using a .NET debugger. To facilitate the creation of runnable programs, chibil includes a minimal stub of a C runtime library located in the crt directory, which provides a necessary main function mechanism to dispatch to the standard C main function with argc and argv. Furthermore, assembly generated during the process is converted into COFF object files via the asm2obj utility, enabling these assembled components to be linked with the C runtime code to construct executables with a functional entry point. Regarding the consumption of C code from .NET code, the functionality is not yet complete. Currently, the compiled code is generated into the global namespace, which presents a challenge for external consumption. To access the compiled code outside the direct execution context, methods such as reflection, specifically utilizing Module.GetMethod, are required to locate and invoke the compiled methods. Supplementary tools are provided to assist in handling the compiled output, including coffobjdumper.cs, which serves as a COFF OBJ dumper for .NET OBJ files, offering a complement to tools like ILDASM for extracting .NET metadata from COFF OBJ files, and dumpbin.exe, which can extract various attributes from COFF objects. |