SlideShare a Scribd company logo
2
Most read
3
Most read
Interpreter Vs Compiler




            By : Aya Yakout Alkhamese



                      Compiler
                           4th
Dept : Computer Science & Information Technology
    Faculty of Science – Portsaid Univeristy
• Interpreter Vs Compiler

 Programming languages can be divided into two major categories: low level and
  high level. “Assembly language” and “machine language” are called low-level
  languages because they more than others “speak” the language the computer
  understands. On the other hand, C, C++, Pascal,Python, Visual Basic, Java,
  and COBOL are high-level languages because they require more manipulation by
  the computer, a process called compiling.



    When writing programs in a high level language, the computer will not be able
    to understand it. So that it will be usable, you need to convert it into
    something that a computer understands. This is where compilers and
    interpreters come in as they both do the same function – convert a high level
    language (like C, Java) instructions into the binary form which is
    understandable by computer hardware. They are the software used to execute
    the high level programs and codes to perform various tasks. Specific
    compilers/interpreters are designed for different high level languages.
    However both compiler and interpreter have the same objective but they
    differ in the way they accomplish their task



 An interpreter :

 reads the source code one instruction or line at a time, converts this line into
  machine code and executes it. The machine code is then discarded and the next line
  is read. executing each line as it is "translated," much the way a foreign language
  interpreter would translate a book, by translating one line at a time.
 The interpreter takes one statement then translates it and executes it and then
  takes another statement.
 interpreter stops translating after the first error.
 Programming Steps for Interpretion :
                      •   Edit the Program
                      •   No linking
                      •   No object code generated
                      •   Source statements executed line by line
 The advantage of this is that :
                    • Interpreters however are easier to use, particularly for
                         beginners, since errors are immediately displayed, corrected
                         by the user, until the program is able to be executed.
                    • you can interrupt it while it is running, change
                         the program and either continue or start again.




   The disadvantage of this is that :
                      • every line has to be translated every time it is executed,
                         even if it is executed many times as the program runs.
                         Because of this interpreters tend to be slow. that
                         interpreted programs run much slower than compiled
                         programs. As much as 5-10 times slower as every line of
                         code has to be re-read, then re-processed.
                      • interpreted programs can only run on computers that also
                         have the interpreter.



    Examples of interpreters are Basic on older home computers, and script
    interpreters such as JavaScript, and languages such as Lisp and Forth.




A compiler :
 reads the whole program (called source code) written in some high level language
  and translates code of a programming language in machine code "binarycode,", also
  called object code. The object code can be executed directly on the machine where
  it was compiled.
    a special program that analyses all the statements in a program (called source
    code) written in some high level language and links the code (using libraries) to
    produce an executable. To run the program you submit the executable which would
    produce some output. To make changes in the program you must repeat these
    steps .
 the compiler translates the entire program in one go and then executes it.
 Compilers, on the other hand, analyse the entire program, taking note of where
  errors have occurred, and places these in an error/diagnostic file. If errors have
  occurred then the program cannot run. Programmers must then use the error
  messages to identify and remove the errors in the source code. Some compilers
  assist by adding line numbers to the source listing to help pinpoint errors .
  compilers offer programmers some advantages. compiled programs make the
  programmer wait until the program is complete.



Programming Steps for Compilation :
 Edit the Program
 parses or analyzes all of the language statements syntactically in a sequential
  manner and then, in one or more successive passes, builds the output code, ensuring
  that statements that refer to other statements are referenced correctly in the
  final code.
 Link the Machine code files into a runnable program (also known as an exe).
 Debug or Run the Program



 The advantage of this is that :
                    • the translation is done once only and as a separate process.
                         The program that is run is already translated into machine
                         code so is much faster in execution.
                    • compiled programs can run on any computer



 The disadvantage of this is that :
                    •    you cannot change the program without going back to the
                        original source code, editing that and recompiling (though
                        for a professional software developer this is more of an
                        advantage because it stops source code being copied, so
                        there’s an element of security built in to compiled
                        programs.).



 Examples of compilers are Visual Basic, C, C++, C#, Fortran, Cobol, Ada, Pascal and
  so on.
 A compiler works with what are sometimes called 3GL and higher-level languages
  (3rd-generation languages, such as Java and C
compiler vs interpreter

More Related Content

PPTX
C Programming Unit-1
PDF
Lecture 01 introduction to compiler
PPT
Python Programming Language
PPTX
Compiler vs interpreter
PPT
c-programming
PPT
32 dynamic linking nd overlays
PPTX
Language processor
PDF
Lecture 3 basic syntax and semantics
C Programming Unit-1
Lecture 01 introduction to compiler
Python Programming Language
Compiler vs interpreter
c-programming
32 dynamic linking nd overlays
Language processor
Lecture 3 basic syntax and semantics

What's hot (20)

PDF
Computer Programming
PPT
Introduction to Compiler Construction
PPTX
Introduction to programming
PPTX
Compiler vs interpreter
PPTX
Compiler vs Interpreter-Compiler design ppt.
PPTX
Parsing in Compiler Design
PPTX
Introduction to programming languages
PDF
15 bitwise operators
PPT
Basics of c++ Programming Language
PPT
structure and union
PPT
Object Oriented Programming Concepts
PPTX
Constants, Variables, and Data Types
PPT
C program
PPT
phases of a compiler
PPTX
Parameter passing to_functions_in_c
PPT
Lecture 5 - Structured Programming Language
PPTX
Programming language
PPTX
Introduction to C programming
PPTX
Lexical Analysis - Compiler Design
PPTX
Operators and expressions in c language
Computer Programming
Introduction to Compiler Construction
Introduction to programming
Compiler vs interpreter
Compiler vs Interpreter-Compiler design ppt.
Parsing in Compiler Design
Introduction to programming languages
15 bitwise operators
Basics of c++ Programming Language
structure and union
Object Oriented Programming Concepts
Constants, Variables, and Data Types
C program
phases of a compiler
Parameter passing to_functions_in_c
Lecture 5 - Structured Programming Language
Programming language
Introduction to C programming
Lexical Analysis - Compiler Design
Operators and expressions in c language
Ad

Viewers also liked (20)

PPTX
Translators(Compiler, Assembler) and interpreter
PPT
Compilers and interpreters
PPT
Language translator
PPTX
Interpreter
PPSX
PPT
Introduction to compiler
PPT
Compiler Design
PPTX
Phases of Compiler
PPT
What is Compiler?
DOCX
Database management system
PPT
Database management system presentation
PPTX
Chapter 2.3
PPT
Computer system
PDF
Compilation v. interpretation
PPT
Using Memoir as a Genre in Writing
PPT
4 various operating systems
PPTX
Interpreted and compiled language
PPTX
Types and components of computer system
PDF
Input and output devices
DOCX
Techniques & applications of Compiler
Translators(Compiler, Assembler) and interpreter
Compilers and interpreters
Language translator
Interpreter
Introduction to compiler
Compiler Design
Phases of Compiler
What is Compiler?
Database management system
Database management system presentation
Chapter 2.3
Computer system
Compilation v. interpretation
Using Memoir as a Genre in Writing
4 various operating systems
Interpreted and compiled language
Types and components of computer system
Input and output devices
Techniques & applications of Compiler
Ad

Similar to compiler vs interpreter (20)

DOCX
COMPILER DESIGN.docx
DOCX
Computer assignment for grade 9
PPTX
Programming Languages / Translators
PPT
La 5 Pl Translator
PPTX
Cf&oa
PPTX
Presentation
PDF
Language processing system.pdf
PDF
2 Programming Language.pdf
PDF
Compilerandinterpreterghhhjjjjjjjjnnn.pdf
PPTX
COMPILER DESIGN OPTIONS
PPTX
Chapter 2 Program language translation.pptx
PPTX
Agro informatics centre up State of Lec 6.pptx
PPTX
Compiler design slide share
PPTX
language and processors.pptx By Dr.Mamoona Anam
PPTX
language and processors.pptx By Dr.Mamoona Anam
PPTX
Introduction to computer and its fundamentals.pptx
PDF
Introduction to compiler
PPT
Computer languages
DOC
Assembler
PPTX
Chapter 5-programming
COMPILER DESIGN.docx
Computer assignment for grade 9
Programming Languages / Translators
La 5 Pl Translator
Cf&oa
Presentation
Language processing system.pdf
2 Programming Language.pdf
Compilerandinterpreterghhhjjjjjjjjnnn.pdf
COMPILER DESIGN OPTIONS
Chapter 2 Program language translation.pptx
Agro informatics centre up State of Lec 6.pptx
Compiler design slide share
language and processors.pptx By Dr.Mamoona Anam
language and processors.pptx By Dr.Mamoona Anam
Introduction to computer and its fundamentals.pptx
Introduction to compiler
Computer languages
Assembler
Chapter 5-programming

More from Faculty of Science , portsaid Univeristy (8)

Recently uploaded (20)

PDF
3.The-Rise-of-the-Marathas.pdfppt/pdf/8th class social science Exploring Soci...
PDF
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
PPTX
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx
PDF
Electrolyte Disturbances and Fluid Management A clinical and physiological ap...
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PDF
High Ground Student Revision Booklet Preview
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Congenital Hypothyroidism pptx
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PPTX
Software Engineering BSC DS UNIT 1 .pptx
PDF
Types of Literary Text: Poetry and Prose
PPTX
IMMUNIZATION PROGRAMME pptx
PPTX
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
PPTX
How to Manage Global Discount in Odoo 18 POS
PDF
Module 3: Health Systems Tutorial Slides S2 2025
PPTX
Strengthening open access through collaboration: building connections with OP...
PPTX
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
PDF
LDMMIA Reiki Yoga Workshop 15 MidTerm Review
PDF
UTS Health Student Promotional Representative_Position Description.pdf
3.The-Rise-of-the-Marathas.pdfppt/pdf/8th class social science Exploring Soci...
PG-BPSDMP 2 TAHUN 2025PG-BPSDMP 2 TAHUN 2025.pdf
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx
Electrolyte Disturbances and Fluid Management A clinical and physiological ap...
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
High Ground Student Revision Booklet Preview
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Congenital Hypothyroidism pptx
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Software Engineering BSC DS UNIT 1 .pptx
Types of Literary Text: Poetry and Prose
IMMUNIZATION PROGRAMME pptx
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
How to Manage Global Discount in Odoo 18 POS
Module 3: Health Systems Tutorial Slides S2 2025
Strengthening open access through collaboration: building connections with OP...
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
Information Texts_Infographic on Forgetting Curve.pptx
LDMMIA Reiki Yoga Workshop 15 MidTerm Review
UTS Health Student Promotional Representative_Position Description.pdf

compiler vs interpreter

  • 1. Interpreter Vs Compiler By : Aya Yakout Alkhamese Compiler 4th Dept : Computer Science & Information Technology Faculty of Science – Portsaid Univeristy
  • 2. • Interpreter Vs Compiler  Programming languages can be divided into two major categories: low level and high level. “Assembly language” and “machine language” are called low-level languages because they more than others “speak” the language the computer understands. On the other hand, C, C++, Pascal,Python, Visual Basic, Java, and COBOL are high-level languages because they require more manipulation by the computer, a process called compiling.  When writing programs in a high level language, the computer will not be able to understand it. So that it will be usable, you need to convert it into something that a computer understands. This is where compilers and interpreters come in as they both do the same function – convert a high level language (like C, Java) instructions into the binary form which is understandable by computer hardware. They are the software used to execute the high level programs and codes to perform various tasks. Specific compilers/interpreters are designed for different high level languages. However both compiler and interpreter have the same objective but they differ in the way they accomplish their task  An interpreter :  reads the source code one instruction or line at a time, converts this line into machine code and executes it. The machine code is then discarded and the next line is read. executing each line as it is "translated," much the way a foreign language interpreter would translate a book, by translating one line at a time.  The interpreter takes one statement then translates it and executes it and then takes another statement.  interpreter stops translating after the first error.  Programming Steps for Interpretion : • Edit the Program • No linking • No object code generated • Source statements executed line by line
  • 3.  The advantage of this is that : • Interpreters however are easier to use, particularly for beginners, since errors are immediately displayed, corrected by the user, until the program is able to be executed. • you can interrupt it while it is running, change the program and either continue or start again.  The disadvantage of this is that : • every line has to be translated every time it is executed, even if it is executed many times as the program runs. Because of this interpreters tend to be slow. that interpreted programs run much slower than compiled programs. As much as 5-10 times slower as every line of code has to be re-read, then re-processed. • interpreted programs can only run on computers that also have the interpreter.  Examples of interpreters are Basic on older home computers, and script interpreters such as JavaScript, and languages such as Lisp and Forth. A compiler :  reads the whole program (called source code) written in some high level language and translates code of a programming language in machine code "binarycode,", also called object code. The object code can be executed directly on the machine where it was compiled.  a special program that analyses all the statements in a program (called source code) written in some high level language and links the code (using libraries) to produce an executable. To run the program you submit the executable which would produce some output. To make changes in the program you must repeat these steps .
  • 4.  the compiler translates the entire program in one go and then executes it.  Compilers, on the other hand, analyse the entire program, taking note of where errors have occurred, and places these in an error/diagnostic file. If errors have occurred then the program cannot run. Programmers must then use the error messages to identify and remove the errors in the source code. Some compilers assist by adding line numbers to the source listing to help pinpoint errors . compilers offer programmers some advantages. compiled programs make the programmer wait until the program is complete. Programming Steps for Compilation :  Edit the Program  parses or analyzes all of the language statements syntactically in a sequential manner and then, in one or more successive passes, builds the output code, ensuring that statements that refer to other statements are referenced correctly in the final code.  Link the Machine code files into a runnable program (also known as an exe).  Debug or Run the Program  The advantage of this is that : • the translation is done once only and as a separate process. The program that is run is already translated into machine code so is much faster in execution. • compiled programs can run on any computer  The disadvantage of this is that : • you cannot change the program without going back to the original source code, editing that and recompiling (though for a professional software developer this is more of an advantage because it stops source code being copied, so there’s an element of security built in to compiled programs.).  Examples of compilers are Visual Basic, C, C++, C#, Fortran, Cobol, Ada, Pascal and so on.  A compiler works with what are sometimes called 3GL and higher-level languages (3rd-generation languages, such as Java and C