Table of Contents
Interpreter vs Compiler
Why we need compiler or interpreter?
Each and every digital machine in the world understands only one language which is called as “Binary Language/Binary Code” Which contains only 2 characters in set and those are “1” and “0”. It is not possible for humans to read and write programs in this languages.
Our code is in language which we can understand but for our system it is foreign language. We need a translator which will translate our code in binary language which will be understandable by compiler. This is where compiler or interpreter comes in the picture. Compiler or Interpreter convert or translate our code to binary code.
Interpreter working

Compiler working

Points | Interpreter | Compiler |
---|---|---|
Compilation process | Scan or interpret the program one statement at a time. | Scan or compile whole program at a time. |
Compilation time | Compilation time is less. | Compilation time is more. |
Intermediate object | It will not generate any intermediate object. | It will generate an intermediate object. |
Execution of control and looping statements | Slow | Fast |
Execution | Interpreter interprets program line by line every time when they are executed. | It compiles entire program ones and can be executed any time. |
Storage space | It requires less storage space. | It requires more storage space. |
Error checking and reporting | It will go on compiling the program unless and until you face any error and will report it. | It will compile the whole program and if it face any error it will list those error after compiling. |
Debugging | Easy in interprete | Difficult in compiler |
Languages | Python, JavaScript, Ruby, etc | C, C++, Java, etc. |