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.07K 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’re right. A compiler is itself a program that is compiled — so you need a program to compile it.

You’ve probably worked out, that you can program a computer by using binary codes directly, whether that involves moving wires, flipping switches, punching holes into paper cards… whatever.

So you do that to write a tiny program that turns a really simple language into binary codes (if you’ve heard of assembly language, that’s an example).

Then you use your simple language to write a bigger and more complicated one.

In modern times, when someone creates a processor, they provide a tiny piece of software that copies code to memory and starts running it, and a program to convert text commands into codes for the processor called an assembler.

Any program can be written in assembly language, but it’s hard because it’s pretty much just writing out the binary codes giving the codes names and using decimal numbers instead of 1’s and 0’s. For that reason they often supply a more useful language, C, that people can more easily use to write software. It’s not uncommon that a compiler is written in C.

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