Thursday, December 16, 2010

Common Language Runtime - CLR

What is a CLR?

This is something you need to know if you say you are working on .Net framework.  

Common Language Runtime (CLR) is an application virtual machine where in programmers need not consider the capabilities of the specific CPU that will execute the program. The .NET Framework provides a run-time environment, which runs the code and provides services that make the development process easier. The class library and the CLR together constitute the .NET Framework.

                    

Developers using the CLR, write code in a language such as C# or VB.NET. At compile time, a .NET compiler converts such code into CIL code. At runtime, the CLR's just-in-time compiler converts the CIL code into code native to the operating system.

The common language runtime makes it easy to design components and applications whose objects interact across languages. Objects written in different languages can communicate with each other, and their behaviors can be tightly integrated. For example, you can define a class and then use a different language to derive a class from your original class or call a method on the original class. You can also pass an instance of a class to a method of a class written in a different language. This cross-language integration is possible because language compilers and tools that target the runtime use a common type system defined by the runtime, and they follow the runtime's rules for defining new types, as well as for creating, using, persisting, and binding to types.

          CLR also provides some of the other services namely:
  • Memory management
  • Thread management
  • Exception handling
  • Garbage collection
  • Security

I will talk about these in detail in the coming blogs. 

No comments:

Post a Comment