Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
Hello
what's the difference between normal compiler and .Net comiler?
Ragards
Posted
Comments
BillWoodruff 6-Nov-14 15:08pm    
What is a "normal" compiler ?
ZurdoDev 6-Nov-14 15:09pm    
A normal compiler compiles normal code; whereas, the .Net compiler compiles .Net code.



Serious, what are you really asking?
Sergey Alexandrovich Kryukov 6-Nov-14 16:02pm    
Incorrect question. There is no such thing as "normal" compiler. And the notion of "difference" is something undefined. If you cannot see it, please tell us the difference between apple and Apple.
—SA

Please see page 11 from the following URL C# Deconstructed: Discover how C# works on the .NET Framework[^].
 
Share this answer
 
The question is pretty much incorrect, but you need to understand what is "compilation" in .NET.
The source code is compiled into CIL. This way, executable code (PE file) of the compiled assembly is abstracted (in a general case) from particular OS and CPU instruction-set architecture.
When the executable file is loaded, the JIT compilation comes into play. Typically, all methods are compiled into the CPU instructions on demand, as each of the methods used is called for the first time.

Please see:
http://en.wikipedia.org/wiki/Common_Intermediate_Language[^],
http://en.wikipedia.org/wiki/Just-in-time_compilation[^].

More traditional model is compilation to object files which are later linked together by a separate program called linker, to make an executable, which is them totally platform-dependent. Please see:
http://en.wikipedia.org/wiki/Compiler[^],
http://en.wikipedia.org/wiki/Object_file[^],
http://en.wikipedia.org/wiki/Linker[^].

See also: http://en.wikipedia.org/wiki/Portable_Executable[^].

—SA
 
Share this answer
 
Comments
Manas Bhardwaj 6-Nov-14 16:18pm    
Yup +5!
Sergey Alexandrovich Kryukov 6-Nov-14 17:15pm    
Thank you, Manas.
—SA
Afzaal Ahmad Zeeshan 7-Nov-14 13:19pm    
This includes way more detail than mine. +5
Sergey Alexandrovich Kryukov 7-Nov-14 14:25pm    
Thank you, Afzaal.
—SA
Afzaal Ahmad Zeeshan 7-Nov-14 14:27pm    
Just kidding, did you notice you're having 911 as your rep. Not sure what you would take it as, "nine one one" or "nine eleven". :D
Roslyn[^] is the .NET compiler. Read the MSDN source document for that.

A normal compiler[^] is a compiler that is a template for every compiler because if you remove the normal (it is normal to remove normal). Rules of the normal compiler and its details can be found at the Wikipedia.

Usually they both compile the source code and convert it into machine (understandable) code for the sake of creating an executable file.
 
Share this answer
 
Comments
Manas Bhardwaj 6-Nov-14 16:19pm    
Agree +5!
Afzaal Ahmad Zeeshan 7-Nov-14 13:13pm    
Thanks Manas. :)
normal compiler will generate (build) native code
.NET compiler will generate(build) Intermediate Language-IL(common language) understandable by all .NET framework supportable languages then to native code
 
Share this answer
 

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