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.
Latest Answers