Monday, January 4, 2010

How CLR Works IN Microsoft .NET


How CLR Works
The result of compiling a C# program is not an executable but it is MSIL
When you compile a C# program output containing MSIL is generated rather than native executable code. It is the job of the CLR to translate the intermediate code into executable code when a program is run. Thus, any program compiled to MSIL can be run in any environment for which the CLR is implemented. This is one of the factors that contribute towards the portability of .NET applications. It is also important to know that CLR converts Microsoft Intermediate Language into executable code by using a JIT compiler. This conversion, as the name of the compiler suggests, is on demand basis as each part of your program is needed.
Managed Code & Unmanaged Code:

Code that is executed by CLR is sometimes referred to as managed code, in contrast to unmanaged code which is the one that is compiled into native machine language rather than MSIL and targets the system directly rather than communicating with CLR.



1 comment:

  1. Is this also the difference between c++ and Visual c++?
    Thanks

    ReplyDelete