Answer the question
In order to leave comments, you need to log in
How does the computer understand the language of the compiler?
The Chicken and Egg Problem
A compiler is a program that translates source code into machine code. And since it is a program, it is also written in some language. Then how does the computer (processor) understand the language of the compiler? If it is essentially itself written in the same programming language that compiles?
Answer the question
In order to leave comments, you need to log in
See "compiler promotion". Briefly, the first compiler is written for a minimal subset of the language in another language (or at the very beginning of the century - in assembler, in mashcodes), then a compiler is written on this subset that can compile this subset, and then language features are built iteratively. A sort of dog food.
Naturally, the compiler is also compiled into machine code and executed like this on the processor.
Just like an interpreter understands the two linguistic sides of speakers who do not understand each other without him.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question