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.09K 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

So the “binary form” is also a programming language itself. It’s just a much “dumber” language that is very hard to use, but can be understood by the machine it’s supposed to run on (namely the CPU).

A compiler is a program that takes a more abstract and easier to use programming language and translates it into that binary executable form.

You don’t need a compiler to run a program. A compiler is basically taking your abstract program and converting it to a binary program that you can run on the machine/operating system itself.

Now there are interpreted languages, but these are usually called *scripts*. An interpreted program (script) does need another program in order to run, that program is called an interpreter and it’s usually written and compiled in a different language.

One more bit of nuance is that most programs today are implicitly compiled to run within certain environments. Namely an operating system. The OS provides a lot of existing code that you can take advantage of when running your program. So the compiler will build your program to run within that environment. The operating system is technically a program itself, and has a lot of control over loading and executing binary programs.

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