Skip to content

How in the world is it written in C#? #69421

Answered by CyrusNajmabadi
Gammer0909 asked this question in Q&A
Discussion options

You must be logged in to vote

A compiler simply takes a source language and converts it to a target language. In our case that is taking in c# and spitting it .net IL.

Originally our compiler was written in c++. Once we had a working compiler we could then use it to compile c# programs to IL.

Later we wrote a compiler in c# to take c# and produce IL. This was originally compiled with the compiler written in c++.

However, once at that point we had C# compiler written in c# and we no longer needed the c++ one.

This process is called "bootstrapping".

--

Note: this is also how we add new language features. The compiler is updated to recognize new language features. We then build the compiler executable that recognizes tho…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Gammer0909
Comment options

@CZEMacLeod
Comment options

@Gammer0909
Comment options

@CyrusNajmabadi
Comment options

Answer selected by sharwell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants