You can always use your favorite compiler A to write another compiler, say B. In this B, you added extra functionality so that it can become your favorite, and you will use it to write the C compiler, ...
How to start? In the old days, people simply filled the memory with raw numbers to directly interpret the CPU. This is why the source is often called code. Once the minimal compiler is programmed this way, it can be executed to create another one written in the compiled language. This can again be used to create a higher level, etc.
In fact, filling raw command codes into memory can itself be seen as a zero-level compilation process where the person is the compiler.
As a rule, the compiler for a given language is written in one language. For example, this refers to the C programming language. This is somewhat more than a coincidence, because whoever knows the language is good enough to dare to write a compiler for it, this language is probably among his favorite for use. This is just a typical case, although not necessary, as there are many languages to choose from, including especially good ones for building a compiler.
source share