Friday, August 19, 2011

Compilers - 3

Ever wondered, how a .net compiler works. I will show you how

.NET compiler :
.net is the framework designed by Microsoft for their windows based operating systems. It gives a great edge for software developers of windows with it's software Visual Studio, the best in class IDE that is available, till date. The IDE is so flexible and intuitive, that even a person with no knowledge of a single programming language, can design softwares in minutes.

Unlike netbeans, the .net framework allows us to use the language of our choice in designing software. Two of the famous languages in .net community are Visual basic and Visual C#. But support for other languages such as Visual F# etc., is also available.

Enough talking, let's see how the program you write, get's compiled and finally runs.

We write a program in the language of our choice in the IDE of Visual Studio. Now in the underlying architecture, it contains the compilers of different languages. Consider we have written the program in Visual C#. The corresponding Visual C# compiler takes the responsibility of compiling the program we have written into a language that is well understood by .net frame work called Microsoft Intermediate Language (MSIL) along with some meta data.

The MSIL and metadata are wrapped into a Portable Executable (PE) and are made available for the later stages.The Just in time (JIT) compiler that is present below it, doesn't compile the whole code into native code, at a time, but compiles it on demand during the execution of code. This gives the justification for it's name Just in time


Tommorrow let's see the working of a GCC compiler

No comments:

Post a Comment