Common Language Runtime
From Wikipedia, the free encyclopedia
The Common Language Runtime (CLR) is the virtual machine component of Microsoft's .NET initiative. It is Microsoft's implementation of the Common Language Infrastructure (CLI) standard, which defines an execution environment for program code. The CLR runs a form of bytecode called the Microsoft Intermediate Language (MSIL), Microsoft's implementation of the Common Intermediate Language.
Developers using the CLR write code in a high level language such as C# or VB.Net. At compile-time, a .NET compiler converts such code into MSIL (Microsoft Intermediate Language) code. At runtime, the CLR's just-in-time compiler (JIT compiler) converts the MSIL code into code native to the operating system. Alternatively, the MSIL code can be compiled to native code in a separate step prior to runtime. This speeds up all later runs of the software as the MSIL-to-native compilation is no longer necessary.
Source code Bytecode Native code
C# compiler ___________
C# ----------------------->| |
| |
| |
VB.NET compiler | | CLR
VB.NET ------------------->| MSIL Code |---------> native code
| |
| |
other compiler | |
Other .NET --------------->| |
language |___________|
\________________________________/ \____________________________/
| |
compile-time runtime
Although some other implementations of the Common Language Infrastructure run on non-Windows operating systems, the CLR runs on Microsoft Windows operating systems.
The virtual machine aspect of the CLR allows programmers to ignore many details of the specific CPU that will execute the program. The CLR also provides other important services, including the following:
- Memory management
- Thread management
- Exception handling
- Garbage collection
- Security
- .NET Framework
- Common Language Infrastructure
- Common Intermediate Language
- Parrot virtual machine
- Java virtual machine
- Portable.NET
- Mono
- Metadata
- Runtime
- Common Type System
- Virtual machine
- C++/CLI
- Overview (Microsoft MSDN)
| Architecture: | Common Language Infrastructure • .NET assembly • .NET metadata • Base Class Library |
| Common Language Infrastructure: | Common Language Runtime • Common Type System • Common Intermediate Language • Virtual Execution System |
| Languages: | C# • Visual Basic .NET • C++/CLI (Managed) • J# • JScript .NET • Windows PowerShell • IronPython • F# |
| Windows Foundations: | Presentation • Communication • Workflow • CardSpace |
| Related: | Windows Forms • ASP.NET • ADO.NET • .NET Remoting • XAML |
| Other Implementations: | .NET Compact Framework • .NET Micro Framework • Shared Source CLI • Portable.NET • Mono |
| Comparison: | C# vs. Java • C# vs. VB.NET |