Interpreter vs Compiler

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

interpreter working
Interpreter working

Compiler working

interpreter working 1
Compiler working
PointsInterpreterCompiler
Compilation processScan or interpret the program one statement at a time.Scan or compile whole program at a time.
Compilation timeCompilation time is less.Compilation time is more.
Intermediate objectIt will not generate any intermediate object.It will generate an intermediate object.
Execution of control and looping statementsSlowFast
ExecutionInterpreter interprets program line by line every time when they are executed.It compiles entire program ones and can be executed any time.
Storage spaceIt requires less storage space.It requires more storage space.
Error checking and reportingIt 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.
DebuggingEasy in interpreteDifficult in compiler
LanguagesPython, JavaScript, Ruby, etcC, C++, Java, etc.

Leave a Comment