Wednesday, April 6, 2011

how c# compiler works?

how c# compiler works??

how it parses our whole solutions and .cs files... i want to know where it start and how everything works... i want to know from the asp.net perspective...

thx

From stackoverflow
  • If you're really interested in how a C# compiler works, you may want to read the source code from Mono's compiler, mcs.

    Callum Rogers : This is actually quite interesting.
  • A really brief explanation could be:

    • In Asp.net, you write an page.aspx file that get compiled into a .Net assembly, this assembly is then used by the Asp.Net runtime that execute http request.
    • This .Net assembly can be written in any .Net language like c# or VB.Net. But in the end, the code is compiled by the .Net CLR compiler into a Common Intermediary Language(CIL). This CIL is used by the CLR runtime which get loaded when you start a .Net process. The JIT then use this CIL and transform it into pure assembly that will be understandable by the computer.
  • Eric Lippert gave a great synopsis of the C# compiler in this answer.

0 comments:

Post a Comment