Difference between compiler and interpreter



Difference between compiler and interpreter
• A complier converts the high level instruction into machine language while an interpreter converts the high level instruction into an intermediate form.
• Before execution, entire program is executed by the compiler whereas after translating the first line, an interpreter then executes it and so on.
• List of errors is created by the compiler after the compilation process while an interpreter stops translating after the first error.
• An independent executable file is created by the compiler whereas interpreter is required by an interpreted program each time.


Interpreter
Compiler
Translates program one statement at a time.
Scans the entire program and translates it as a whole into machine code.
It takes less amount of time to analyze the source code but the overall execution time is slower.
It takes large amount of time to analyze the source code but the overall execution time is comparatively faster.
Continues translating the program until the first error is met, in which case it stops. Hence debugging is easy.
It generates the error message only after scanning the whole program. Hence debugging is comparatively hard.
Programming language like Python, Ruby use interpreters.
Programming language like C, C++ use compilers.

SHARE

About df

    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment