Eli5: If a compiler is a program that converts your code into binary form for the computer, unless my understanding is incorrect and it isn’t just a program, wouldn’t the compiler also need a compiler to run it since how do you run a program without a compiler?

1.05K views

Eli5: If a compiler is a program that converts your code into binary form for the computer, unless my understanding is incorrect and it isn’t just a program, wouldn’t the compiler also need a compiler to run it since how do you run a program without a compiler?

In: 360

25 Answers

Anonymous 0 Comments

You are correct: compilers are programs, and to become programs, they need to be compiled by another compiler. The very first compilers were written directly in machine code to avoid needing a compiler.

There are plenty of existing compilers that one can use to build a new compiler, and at some point the compiler can become “self-hosting” in the sense that an existing compiled version of that compiler can be used to compile the next version.

You are viewing 1 out of 25 answers, click here to view all answers.