Generated by GPT-5-mini| Common Intermediate Language | |
|---|---|
| Name | Common Intermediate Language |
| Paradigm | Intermediate language, bytecode |
| Developer | Microsoft |
| First appeared | 2002 |
| File extension | .dll, .exe |
Common Intermediate Language Common Intermediate Language is an intermediate bytecode language designed for the Microsoft .NET Framework, serving as a platform-neutral instruction set consumed by virtual machines and just-in-time compilers. It enables language interoperability among compilers for languages such as C#, Visual Basic .NET, F#, and others while integrating with runtime environments like Common Language Runtime in implementations such as .NET Core, Mono, and CoreCLR. CIL sits between high-level language compilers and runtime loaders, facilitating features found in ecosystems including Visual Studio, Microsoft Research, ECMA International, and vendor implementations from Red Hat and Xamarin.
CIL functions as a stack-based instruction set specified by standards bodies such as ECMA International and used by platforms including .NET Framework, .NET Core, and Mono. It is emitted by compilers for languages like C#, Visual Basic .NET, F#, J#, and alternative compilers from projects such as Roslyn and IKVM.NET. Executables produced by compilers are packaged with metadata in formats like Portable Executable and consumed by runtimes such as Common Language Runtime and CoreCLR. Implementations include proprietary stacks from Microsoft and open-source efforts from Xamarin, Mono, and community projects under organizations such as Apache Software Foundation and Linux Foundation.
The lineage of CIL traces to early work at Microsoft Research and language-runtime integrations in the late 1990s. Standardization efforts led to ECMA specifications ratified by ECMA International and later adopted in ISO discussions involving stakeholders including Microsoft and open-source communities such as Mono contributors. Key product milestones occurred with the release of .NET Framework versions, integration into developer tools like Visual Studio, and cross-platform initiatives such as .NET Core and the acquisition of Xamarin by Microsoft. Academic engagement appeared in conferences like ACM SIGPLAN Conference on Programming Language Design and Implementation and publications sponsored by IEEE and ACM. Commercial and open-source implementations evolved alongside projects from companies including Novell, Red Hat, JetBrains, Google, and Intel. Standards work involved groups and events such as ECMA TC39 discussions, interop testing in consortia including ISO/IEC panels, and workshops at venues like Microsoft Build and GOTO (conference).
The CIL specification, formalized by ECMA International in standards documents, defines metadata, type systems, verification rules, and an instruction set used across languages including C#, Visual Basic .NET, and F#. Features include a Common Type System influenced by work at Microsoft Research, support for value types and reference types implemented by compilers like Roslyn, exception handling constructs compatible with frameworks such as Windows Presentation Foundation and ASP.NET Core, and attributes interoperable with metadata tools produced by JetBrains and Red Hat. The instruction set supports method invocation patterns used by libraries such as Entity Framework, security annotations familiar to OWASP practitioners, and reflection interfaces consumed by projects like Newtonsoft.Json and Microsoft.Extensions.DependencyInjection.
CIL is generated by compilers targeting platforms such as Visual Studio and consumed by runtimes like Common Language Runtime and CoreCLR. During deployment, binaries in formats like Portable Executable are loaded by loaders implemented in projects such as Mono and CoreRT; just-in-time compilation transforms CIL to native code using backends from vendors including Intel and AMD. Ahead-of-time compilation options appear in toolchains from Microsoft and community projects integrated into CI systems like Jenkins and Azure DevOps. Runtime services include garbage collection strategies influenced by research from Microsoft Research and IBM, profiling APIs consumed by tools such as JetBrains dotTrace and PerfView.
A broad ecosystem surrounds CIL, including compilers and toolchains like Roslyn, decompilers such as ILSpy, commercial tools from JetBrains, and package management via NuGet. Debuggers in environments like Visual Studio, inspectors in WinDbg, analyzers from SonarSource, and continuous integration systems including Azure DevOps and GitHub Actions work with CIL artifacts. Interpreters and alternative runtimes such as Mono and CoreCLR enable cross-platform development on platforms maintained by Canonical (company), Red Hat, and Apple Inc.. Language implementations from vendors like Microsoft, community projects under Apache Software Foundation, and research prototypes in institutions such as MIT and Stanford University extend the tooling set.
CIL includes verification rules specified by ECMA International enforced by runtimes such as Common Language Runtime and CoreCLR to ensure type safety and reduce vulnerabilities examined by organizations like OWASP and CERT. Code access security models introduced by Microsoft and later modified in .NET Core impacted how signatures and strong names from authorities such as VeriSign were used. Static analysis and formal methods from labs at Microsoft Research, MIT, and ETH Zurich inform verifiers and tools like FxCop and analyzers in SonarQube and Coverity. Security incidents and response practices involve vendors such as Microsoft Security Response Center and standards bodies like ISO/IEC.
CIL's platform-agnostic specification allowed implementations on platforms including Windows NT, Linux, and macOS via projects like Mono and Xamarin. Interop layers enable calling native libraries such as those from Microsoft Windows API and cross-language bridges employed in frameworks like Qt and Electron (software) when integrating GUIs from Windows Presentation Foundation or GTK+. Academic and commercial ports target hardware architectures supported by Intel, AMD, ARM Limited, and cloud providers including Amazon Web Services, Microsoft Azure, and Google Cloud Platform. Community standards and interoperability testing involve organizations such as ECMA International, ISO/IEC, and consortia including Linux Foundation.