Compilation model followed by .net applications

Single step VS two step compilation

There are two types of compilation models followed by programming languages – one step and two step compilation. Languages like C and C++ follow a single step compilation where the program source code is directly converted into machine code which is understandable by the CPU. But languages like C#, VB.net, Java follow a two step compilation model. In the first step the source code is compiled and converted to another language generally called the intermediate language. In the second step the intermediate language is converted into the final machine code which is understandable by the CPU.

Microsoft Intermediate Language (MSIL) or Common Intermediate Language (CIL)

All applications built using the .net framework follow a two step compilation model. In the first step the program source code is converted into an intermediate language called the MSIL or Microsoft Intermediate Language. Another name for MSIL is CIL or Common Intermediate Language. It is called common intermediate language because it does not matter which language you are using, C# or VB.net or any other .net language, every language will be converted into the same intermediate language. By looking at the intermediate language you cannot tell the original programming language that was used to write the program source code.

Just In Time Compilation

At the end of the first step the original program source code is converted into MSIL or CIL. The first step is the responsibility of the language compiler. This means that to compile the C# source code you will use a C# compiler and to compile the VB.net source code you will use the VB.net compiler. The second step is the responsibility of the JIT compiler, also called the Just In Time Compiler. The JIT compiler is a part of the CLR and is responsible for converting the intermediate language into the final source code.
Depending on the machine where you wish to execute your program you will get a different JIT compiler. There will be a different JIT compiler for a 32 bit machine and a different JIT compiler for a 64 bit machine. This is why applications built using the .net framework are portable and can run on any machine you want. The only condition is that there should be a .net framework available for that machine.

Look at the diagram below to understand the compile .net compilation model

.net compilation model

Quick Links

E-Magazines

@

Total Followers
Study Group Created
Study Group Joined
Following Teacher
Following Organization
Blog Articles Added
Questions Asked
Questions Answered
Jobs Posted
Total Members in Group
Questions asked by members
Tasks added in this Group

Please wait..

Ok

Login to Open ESchool OR Create your account    Login   SignUp