21 April 2013

IL is same for CLR supporting language

Multiple languages target their code execution on Common language runtime (CLR). All programming language targeting CLR produce the IL code after compilation. IL is also referred as Microsoft Intermediate Language or in short MSIL. Later the IL language code gets converted to machine level language, specific to CPU using Just In Compiler.

With that said lets us look into a question on CLR:

By looking at the IL code can we tell which high-level language the code was written?

Answer is NO. The generated IL has to get's executed on the CLR, which is not language specific.

During Compilation, the high-level language like, C#, VB.NET, F# code will get converted to MSIL. The language-specific constructs in the code will get converted to CLR constructs during the compilation. Producing the IL language code compatible with the CLR is the responsibility of the individual language compiler.