Python - PPT Cie
Python - PPT Cie
S Manjula
CSM B
22951A6665
WHAT IS COMPILER?
•A compiler is a computer program that transforms code written in a high -level
programming language into the machine code. It is a program which translates
the human -readable code to a language a computer processor understands
(binary 1 and 0 bits). The computer processes the machine code to perform the
corresponding tasks.
•A compiler should comply with the syntax rule of that programming language in
which it is written. However, the compiler is only a program and can not fix errors
found in that program. So, if you make a mistake, you need to make changes in
the syntax of your program. Otherwise, it will not compile.
WHAT IS INTERPRETER?
• Compiler transforms code written in a high-level programming language into the machine
code, at once, before program runs, whereas an Interpreter converts each high
-level program
statement, one by one, into the machine code, during program run.
• Compiled code runs faster while interpreted code runs slower.
• Compiler displays all errors after compilation, on the other hand, the Interpreter displays
errors of each line one by one.
• Compiler is based on translation linking-loading model, whereas Interpreter is based on
Interpretation Method.
• Compiler takes an entire program whereas the Interpreter takes a single line of code.
KEY DIFFERENCE
• An interpreter for python is an important concept for web
development and computer programming. A Python interpreter and
compiler are quite similar to one another. Essentially, they both do the
same job, but in very different ways. Each has a slightly different
procedure when generating a source code, but the end result remains
the same.
• Python interpreter uses a line-by-line approach whereas the
compiler opts for a whole program approach. They both have their
advantages and disadvantages but they make the overall process
quicker and easier for all.
Compiler and interpreter both are intended to do
the same work but differ in operating procedure,
Compiler takes source code in an aggregated way
whereas Interpreter takes constituent parts of
source code, i.e., statement by statement.
CONCLUSION
Although both compiler and interpreter have
certain advantages and disadvantages like
Interpreted languages are considered as cross-
platform, i.e., the code is portable. It also doesn’t
need to compile instruction previously unlike
compiler which is time-saving. Compiled languages
are faster regarding the compilation process.