Learnmonkey Learnmonkey Logo

Interpreters and Compilers

If you have been exposed to programming before, you may have seen the words "interpreter" and "compiler".

What is an Interpreter?

Put simply, the interpreter goes through your code line by line, running it as it goes. An example of an interpreted language is Python.

What is a Compiler?

Unlike an interpreter, compilers look at your entire program at once and turns it into machine code, which is basically just binary that your computer can natively run. Then, you can run the machine code. An example of a compiled language is C/C++.

What about a Compiled AND Interpreted Language?

Yes, that exists. It's called Java. Java first compiles your Java code into bytecode, which ends in a .class file. (This is what the "javac" command does) Then, Java interprets the bytecode. (This is the "java" command)