0% found this document useful (0 votes)
121 views

Interpreter Vs Compiler

An interpreter translates program statements one at a time and runs the program, making debugging easier but overall execution slower, whereas a compiler scans the entire program and converts it to machine code at once, making execution faster but debugging harder. Interpreters are more memory efficient as they do not generate intermediate object code, while compilers generate object code requiring additional linking and memory. Popular interpreted languages include Python and Ruby, while compiled languages are C and C++.

Uploaded by

Som Krishna
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views

Interpreter Vs Compiler

An interpreter translates program statements one at a time and runs the program, making debugging easier but overall execution slower, whereas a compiler scans the entire program and converts it to machine code at once, making execution faster but debugging harder. Interpreters are more memory efficient as they do not generate intermediate object code, while compilers generate object code requiring additional linking and memory. Popular interpreted languages include Python and Ruby, while compiled languages are C and C++.

Uploaded by

Som Krishna
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Interpreter Vs Compiler : Difference

Between Interpreter and Compiler


We generally write a computer program using a high-level language. A highlevel language is one which is understandable by us humans. It contains
words and phrases from the English (or other) language. But a computer
does not understand high-level language. It only understands program
written in 0's and 1's in binary, called the machine code. A program written
in high-level language is called a source code. We need to convert the
source code into machine code and this is accomplished my compilers and
interpreters. Hence, a compiler or an interpreter is a program that converts
program written in high-level language into machine code understood by the
computer.
The difference between an interpreter and a compiler is given below:
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.

No intermediate object code is


generated, hence are memory
efficient.

Generates intermediate object


code which further requires
linking, hence requires more
memory.

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.

You might also like