What Is the Common Language Runtime?

   

The .NET Framework runtime environment is known as the common language runtime, or CLR. All .NET applications are executed by the CLR, which provides memory management and manages the overall execution of the application. Any code written that executes within the CLR is known as managed code. Therefore, all .NET Framework code is managed because it executes within the CLR.

Having a managed execution environment has many benefits, including cross-language integration, cross-language exception handling, better security, versioning and deployment, simple component interaction, and debugging.

The CLR provides another benefit for developers: a common runtime base that all .NET languages are based on. This allows any .NET component or module to work with other .NET components regardless of the language in which they were written. All .NET languages that produce code for the CLR generate code according to the common language specification (CLS). This specification dictates how code is generated so that it is all done the same across all languages.

When a .NET language compiles managed code, it actually is precompiling the code into another language that is the common language for all .NET compilers. This language is called the Microsoft Intermediate Language (MSIL). This language is compiled by the just-in-time (JIT) compiler at runtime when an application is first executed. Using a JIT compiler allows the .NET application to be compiled and optimized for the machine on which it is executing.

The .NET Framework is capable of using code from all different languages because, by the time the CLR uses the code, the code is resolved into a common base language with all the same types and methods for handling errors, events, user interface, and so on.


   
Top


Sams Teach Yourself Visual C++. NET in 24 Hours
Sams Teach Yourself Visual C++.NET in 24 Hours
ISBN: 0672323230
EAN: 2147483647
Year: 2002
Pages: 237

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net