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

Difference Between Compiler and Interpreter

The document compares compilers and interpreters. A compiler converts source code directly into machine code, while an interpreter executes code line-by-line without producing machine code. Compilers perform optimizations that allow compiled code to run faster than interpreted code, but any changes to source code after compilation require recompiling the entire program. Interpreters execute code more slowly than compilers but allow changing the source code without retranslating the whole program. Common compiled languages include C and C++, while interpreted languages include Python and Ruby.

Uploaded by

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

Difference Between Compiler and Interpreter

The document compares compilers and interpreters. A compiler converts source code directly into machine code, while an interpreter executes code line-by-line without producing machine code. Compilers perform optimizations that allow compiled code to run faster than interpreted code, but any changes to source code after compilation require recompiling the entire program. Interpreters execute code more slowly than compilers but allow changing the source code without retranslating the whole program. Common compiled languages include C and C++, while interpreted languages include Python and Ruby.

Uploaded by

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

Difference Between Compiler and Interpreter

Compiler Interpreter

Steps of Programming:
 Program Creation.
 Analysis of language
by the compiler and
throws errors in case
of any incorrect Steps of Programming:
statement.  Program Creation.
 In case of no error,  Linking of files or generation of
the Compiler Machine Code is not required by
converts the source Interpreter.
code to Machine  Execution of source statements one by
Code. one.
 Linking of various
code files into a
runnable program.
 Finally runs a
Program.

The compiler saves the


The Interpreter does not save the Machine
Machine Language in form of
Language.
Machine Code on disks.

Compiled codes run faster than


Interpreted codes run slower than Compiler.
Interpreter.

Linking-Loading Model is the


The Interpretation Model is the basic working
basic working model of the
model of the Interpreter.
Compiler.

The compiler generates an


The interpreter does not generate any output.
output in the form of (.exe).

Any change in the source


Any change in the source program during the
program after the compilation
translation does not require retranslation of the
requires recompiling the entire
entire code.
code.
Compiler Interpreter

Errors are displayed in


Compiler after Compiling Errors are displayed in every single line.
together at the current time.

The compiler can see code


The Interpreter works by line working of Code,
upfront which helps in running
that’s why Optimization is a little slower compared
the code faster because of
to Compilers.
performing Optimization.

It does not require source code


It requires source code for later execution.
for later execution.

Execution of the program takes


Execution of the program happens after every line
place only after the whole
is checked or evaluated.
program is compiled.

Compilers more often take a


In comparison, Interpreters take less time for
large amount of time for
analyzing the source code.
analyzing the source code.

CPU utilization is more in the


CPU utilization is less in the case of a Interpreter.
case of a Compiler.

The use of Compilers mostly


The use of Interpreters is mostly in Programming
happens in Production
and Development Environments.
Environment.

Object code is permanently


No object code is saved for future use.
saved for future use.

C, C++, C#, etc are


Python, Ruby, Perl, SNOBOL, MATLAB, etc are
programming languages that
programming languages that are interpreter-based.
are compiler-based.

You might also like