Where can I read what the C # compiler does?

On this site, I usually see people answer questions with answers such as "does it work because the compiler replaces [thing] with [another thing]", so my question is how do people know / learn about it? Where can I find out these things?

+7
source share
5 answers

The most specific source of how C # code is interpreted is the C # language specification.

In addition, the following blogs provide much more information about C #. A compulsory reading for those who want to become an expert in the language

+13
source

One way is to compile your code and then decompile it with tools like ILSpy . Using such a tool, you can view the source IL and see what the compiler produces.

+2
source

In addition to the other answers, I would like to mention that LINQPad is my favorite tool for checking IL for fast fragments.

You can enter a code snippet and see IL immediately.
This is the easiest tool to use, and you can make changes and see the results instantly.

+1
source

In addition to checking the intermediate language and reading the language specification, please allow me to add Jeffrey Richter's β€œ CLR via C # ”. Microsoft Press Library of Congress Control number: 2009943026. This link is amazing and details what is happening under the covers.

0
source

Nicklaus Wirth's book Compiler Design (PDF) is an introduction to the theory and methods of compiler construction. This gives you a general idea of ​​what a compiler is and what it does.

0
source

All Articles