Is C# partially interpreted or really compiled?

John V picture John V · Jan 12, 2012 · Viewed 85.4k times · Source

There is a lot of contradicting information about this. While some say C# is compiled (as it is compiled into IL and then to native code when run), others say it's interpreted as it needs .NET. EN Wiki says:

Many interpreted languages are first compiled to some form of virtual machine code, which is then either interpreted or compiled at runtime to native code.

So I'm quite confused. Could anyone explain this clearly?

Answer

Simon picture Simon · Jan 12, 2012

C# is compiled into IL, by the c# compiler.

This IL is then compiled just-in-time (JIT) as it's needed, into the native assembly language of the host machine. It would be possible to write a .NET runtime that interpreted the IL instead though. Even if this was done, I'd still argue that c# is a compiled language.