Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In which language is the C# compiler written?

People also ask

Which language is used in C?

It was based on CPL (Combined Programming Language), which had been first condensed into the B programming language—a stripped-down computer programming language—created in 1969–70 by Ken Thompson, an American computer scientist and a colleague of Ritchie.

Is C -- a coding language?

C-- (pronounced C minus minus) is a C-like programming language. Its creators, functional programming researchers Simon Peyton Jones and Norman Ramsey, designed it to be generated mainly by compilers for very high-level languages rather than written by human programmers.

Why C is a language?

As a middle-level language, C combines the features of both high-level and low-level languages. It can be used for low-level programming, such as scripting for drivers and kernels and it also supports functions of high-level programming languages, such as scripting for software applications etc.


The original C# compiler wasn't written in C#, it was in C and C++. The new Roslyn compiler was written in C#, but was initially compiled with the old compiler. Once the new compiler was done, it was able to compile its own source code: this is called bootstrapping.


Compilers are utility programs - they turn programming language text into machine code. If the programming language describes software that just happens to be a compiler.....

Compilers can also produce machine code for other architectures. For example, Apple compiles iOS using racks of Intel-based servers. The compiler does not have to run the ARM code it generates, just write it to disk.

Compiler 2.0 must be written in a language compiler 1.0 can process, but it can certainly create compiler 2.0 with newer features like optimization. You can then re-compile the source code using compiler 2.0 and make a better version of itself. Again, the compiler doesn't know it's making another version of itself.

If we go far enough back into the mists of time then we do reach a point where we have no compiler - the very first iteration of a high-level language. Then we have to get out the pencils and opcode books and write the first one in assembly. How did we write the first assembler? Direct machine code entry, probably on punched paper tape, or flipping switches on the front panel.


A compiler is just a program like any other program. There is nothing magical or special about it. It takes some input and produces some output. In this particular case, the input just happens to be C# and the output just happens to be CIL, but that's no different from the input being a series of tax returns and the output being a report.