P
P
pandaa2020-05-02 17:41:22
Programming languages
pandaa, 2020-05-02 17:41:22

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

3 answer(s)
D
Denis Zagaevsky, 2020-05-02
@pandaa

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.

1
15432, 2020-05-02
@15432

Naturally, the compiler is also compiled into machine code and executed like this on the processor.

X
xmoonlight, 2020-05-02
@xmoonlight

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 question

Ask a Question

731 491 924 answers to any question