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

A compiler compiles your program into machine code (or any other language, but let’s ignore that for now). The compiled program can then be run on your machine (computer) because it’s already in the machine code the machine can run. So yes, someone had to compile the compiler at some point, but then it’s already compiled, so it doesn’t need the compiler anymore.

What you’re thinking about is probably the interpreter, which is a program that takes a program in some language, and actually performs the actions the program was supposed to perform. Therefore it needs to be present any time you want to run the interpreted program. You could say that the processor is an interpreter for machine code.

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