Compiler And Interpreter

  

Compiler:

Compiler translate the whole program into a machine code at once. It take large amount of time to analyze the source code. The program written in high level language consist of different subprogram. These subprogram have different library. When compiler translate these program it will create object file for each program. Then this object file will link with library to create machine code.

Compiler are faster than interpreters. Compile require more memory space. Programming language like C,C++ use compiler.

Interpreter:

Interpreter read the program line by line, and it convert each line into machine code. It translate one statement at a time. It take less amount of time to analyze the source code.

Interpreter hand over control to computer after translation of first line and then computer execute the machine code for first line and gave control to interpreter. In this way interpreter translate the second line of program and this process till the interpreter reach to the end of program.

Interpreter are slower and require less memory space. Programming language like Python, Ruby, dbase use interpreter.


Comments