Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Is CLR, a COMPILER or an EXECUTION ENGINE?

Although, this is a theoretical question, it needs some light on it.

Please help.
Posted
Updated 1-Jan-11 1:25am
v2

The CLR is an execution engine: The various compilers target the CLR, it has no idea what language code was written in when it runs.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Jan-11 6:55am    
This is a good short answer, just to the point - my 5.
I will add an idea what to read about.
Manfred Rudolf Bihy 1-Jan-11 12:04pm    
Agreed! 5+
The answer by OriginalGriff is very good. I only want to add an idea what is essential to know: you need to understand that compilation is divided between two major phases: compilation into byte code (CIL code; this is what a .NET compilers do) and Just In Time compilation (JIT) which is done after loading of the byte code and interlaced with run-time.

In fact, JIT compiler compiles into native (CPU) code on per-method basis; as a result, even if some dead code is present in the assembly, it will be never JIT-compiled; and even non-dead code may or may not be compiled if the call depends on run-time conditions.

This is a good reading for to start with: http://en.wikipedia.org/wiki/Common_Language_Runtime[^]
 
Share this answer
 
Comments
Manfred Rudolf Bihy 1-Jan-11 12:04pm    
Good link! 5+
Espen Harlinn 28-Feb-11 15:43pm    
Nice reply, my 5
Sergey Alexandrovich Kryukov 1-Mar-11 3:56am    
Thank you, Espen,
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900