Saturday, 3 May 2014

What is Common Language Runtime in C#?

What is Common Language Runtime in Csharp?
Today in this article I will discuss the very basic and starting topic of C# programming language because if the basics are strong then you will be survive in future of programming. It is very necessary to know that how the program compile and run in Microsoft .NET Framework let’s start it.

  • As part of Microsoft  .NET Framework CLR is programming(Virtual Machine component) that manages the execution of programs that is written in any language that is supported by .NET Framework e.g  C#,VB,F# etc
  • Programmers write code in any language VB,C#,F# they compile their programs into an intermediate form of code called CLI in a portable execution file(PE) that can be manage and use by CLR and then CLR converts  it into machine code then it will executed by processor.
  • The information about the environment, programming language , its version, what class libraries will be used for this code stored in the form of meta data with the compiled which tells the CLR how to handle this code.
  •  CLR allows an instance of class written in one language to call a method of class written in another language.

Got it ? or not ? I will make this more easy for you people by making the whole picture of this description.
Visualize the concept then understanding will be easy.

Functions of CLR:

  • Convert code in to CLI
  • Exception handling
  • Type safety
  • Memory management(using Garbage Collector)
  • Security
  • Improve performance
  • Language independency
  • Platform independency
  • Architecture independency

Components of CLR:

  •  Class Loader:
  • Used to load all classes at run time.
  • MSIL to Native code
  • It’s  JTI (just in time) compiler it will convert MSIL code into native code. 
  • Code Manager:
  • It manages the code at run time. 
  •  Garbage Collector:
  • It manages the memory. Collect all unused object and de deallocate them when the memory becomes less.
  • Thread Support:
  • It support multithreading to our application.
  • Exception Handler:
  • It handles exceptions at run time.

Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...


Post a Comment