← Back to context

Comment by userbinator

15 hours ago

It's because a compiler is supposed to be high-level to low-level; you already have a lower-level language to write in it, and not a higher-level one. Writing a C compiler in a higher-level language than C is going backwards.

E.g., Pascal compilers have traditionally been written in Pascal, hardly a language which conjures up a "low level" image.

How could the first Pascal compiler be compiled if it was written in Pascal, but a Pascal compiler didn't yet exist?

> How could the first Pascal compiler be compiled if it was written in Pascal, but a Pascal compiler didn't yet exist?

Therein lies the magic of bootstrapping a language compiler written in the same language. Look it up.

  • You need a different compiler to compile the first one. You are the one who needs to "look it up".