Compilation Vs.
Interpretation
Source Code Translators
An Interpreter is a
Translator
Examples of translators:
● Compilers - translates high level code to low level code, e.g. Java -> JVM
● Assemblers - translates assembly language code to machine code, e.g. x86as -> x86
● High-level translators - translates code from one PL to another, e.g. Java -> C
● Decompilers - translates low-level code to high-level code, e.g. Java JVM bytecode -> Java
High Level / Low Level
Low High
Machine Readable Human Readable
Binary: 011011 Grammar: if let, while, for
executable Not executable
Knows about hardware Does not know about hardware
A compiler can be compared to taking a foreign
movie and first sub-titling it and then being able to
watch it again and again.
While an interpreter is like having a translator at the
UN translate each line of a delegate’s speech in real-
time.
AKA...
The compiler translates the entire program before it is run.
The interpreters translate a line at a time while the program is being run.
Compilation v. interpretation
Compiled Languages
Python
Javascript
Lisp
Java ( compiled to byte code first )
C# (compiled to MSIL)
PHP
Perl
Interpreted Languages
C
C++
Objective-C
Swift
Fortran
Advantages of Compiled Languages
- Pre-Compiled binaries are inherently more difficult to reverse-engineer and
are therefore helpful to closed-source software providers wishing to keep the
I.P. contained in their source code private.
- Once a program is translated into native instructions (machine code), it can
then be executed over and over again withouth the overhead of this
translation.
- Ability to support architectures the interpreter hasn't been compiled for (such
as embedded systems)
- Can be optimized more heavily due to larger window of code to be translated.
Advantages of Interpreted Languages
- Programs can immediately be executed without the requirement of compiling
first.
- Potentially has lower memory footprint because no Object Code is created.
- Supports portability if interpreter is installed on different platforms.
- Starts executing immediately (no compilation phase)
- Source Code can be more easily changed between program executions
because there is no compilation step in between.
Hybrid Approach
An interpretive compiler combines fast translation with moderately fast execution, provided that:
● VM code is lower than the source language, but higher than native machine code
● VM instructions have simple formats (can be quickly analysed by an interpreter)
Example: JDK provides an interpretive compiler for Java.
Hybrid Approach Continued..
- any language can be either compiled or interpreted but the implementation of the language is what is either one or both. Sometimes even a
spectrum of compiled/interpreted
- Etymology - compiler (pile things together, throw in pile), interpreter (inter, between source and assembly)
- Interpreted languages require the interpreted to be installed on host machine
- Interpreter continues interpreting until it hits an error
- Compiler will check errors for you at compilation time
- Compiled program requires more memory as all the code is compiled as opposed to line by line discarding the previous line. However with
modern computers equipped with gigabytes of ram this isn’t a practical concern.
Extra Points

More Related Content

PPSX
Cocomo model
PDF
Lecture-1: Introduction to web engineering - course overview and grading scheme
PPT
1.1 The nature of software.ppt
PPTX
Insertion Sorting
PPT
B trees in Data Structure
PPTX
History of OS
PPT
Chapter 01
PPTX
Batch operating system
Cocomo model
Lecture-1: Introduction to web engineering - course overview and grading scheme
1.1 The nature of software.ppt
Insertion Sorting
B trees in Data Structure
History of OS
Chapter 01
Batch operating system

What's hot (20)

PPT
Computer programming concepts
DOC
PPT
Web Engineering
DOCX
Software engineering
PPTX
Introduction to Software Engineering
PPT
extreme Programming
PPT
10 software maintenance
PPTX
PPTX
Interpreted and compiled language
PDF
Visual basic 6.0
PPTX
Introduction to Compilers
PDF
Linker and Loader Explained
PPTX
Graphical user-interface
PPT
Real Time Software Design in Software Engineering SE13
PPTX
Software Cost Estimation Techniques
PDF
Software Engineering - Ch1
PPTX
The Extreme Programming (XP) Model
PPTX
PPTX
Software Engineering concept
PPTX
Selection sort algorithm presentation, selection sort example using power point
Computer programming concepts
Web Engineering
Software engineering
Introduction to Software Engineering
extreme Programming
10 software maintenance
Interpreted and compiled language
Visual basic 6.0
Introduction to Compilers
Linker and Loader Explained
Graphical user-interface
Real Time Software Design in Software Engineering SE13
Software Cost Estimation Techniques
Software Engineering - Ch1
The Extreme Programming (XP) Model
Software Engineering concept
Selection sort algorithm presentation, selection sort example using power point
Ad

Similar to Compilation v. interpretation (20)

PPTX
Cf&oa
PPT
La 5 Pl Translator
PPTX
Insight into progam execution ppt
PDF
Language processing system.pdf
DOCX
COMPILER DESIGN.docx
PPTX
Computer Science guide to C Unit-I Translator.pptx
PPTX
Compiler vs interpreter
PDF
Compilerandinterpreterghhhjjjjjjjjnnn.pdf
PPTX
Life cycle of a computer program
DOCX
Computer assignment for grade 9
PPTX
language and processors.pptx By Dr.Mamoona Anam
DOC
Assembler
PDF
compilervsinterpreter-161008074915.pdf
PPTX
Compiler vs interpreter
PPTX
Cd ch1 - introduction
PPTX
CD - CH1 - Introduction to compiler design.pptx
PPTX
4_5802928814682016556.pptx
PPTX
Compiler - Computer Programming - UOZ
PDF
Compiler type
PPTX
Programming Languages / Translators
Cf&oa
La 5 Pl Translator
Insight into progam execution ppt
Language processing system.pdf
COMPILER DESIGN.docx
Computer Science guide to C Unit-I Translator.pptx
Compiler vs interpreter
Compilerandinterpreterghhhjjjjjjjjnnn.pdf
Life cycle of a computer program
Computer assignment for grade 9
language and processors.pptx By Dr.Mamoona Anam
Assembler
compilervsinterpreter-161008074915.pdf
Compiler vs interpreter
Cd ch1 - introduction
CD - CH1 - Introduction to compiler design.pptx
4_5802928814682016556.pptx
Compiler - Computer Programming - UOZ
Compiler type
Programming Languages / Translators
Ad

Recently uploaded (20)

PPTX
wireless networks, mobile computing.pptx
PDF
Implantable Drug Delivery System_NDDS_BPHARMACY__SEM VII_PCI .pdf
PPTX
Amdahl’s law is explained in the above power point presentations
PDF
Computer System Architecture 3rd Edition-M Morris Mano.pdf
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PPTX
Module 8- Technological and Communication Skills.pptx
PDF
Applications of Equal_Area_Criterion.pdf
PPTX
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
PPTX
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PDF
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
PDF
Design Guidelines and solutions for Plastics parts
PPTX
ai_satellite_crop_management_20250815030350.pptx
PPTX
Measurement Uncertainty and Measurement System analysis
PPTX
Software Engineering and software moduleing
PPTX
Petroleum Refining & Petrochemicals.pptx
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PPTX
Building constraction Conveyance of water.pptx
wireless networks, mobile computing.pptx
Implantable Drug Delivery System_NDDS_BPHARMACY__SEM VII_PCI .pdf
Amdahl’s law is explained in the above power point presentations
Computer System Architecture 3rd Edition-M Morris Mano.pdf
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
Module 8- Technological and Communication Skills.pptx
Applications of Equal_Area_Criterion.pdf
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
Design Guidelines and solutions for Plastics parts
ai_satellite_crop_management_20250815030350.pptx
Measurement Uncertainty and Measurement System analysis
Software Engineering and software moduleing
Petroleum Refining & Petrochemicals.pptx
Exploratory_Data_Analysis_Fundamentals.pdf
Building constraction Conveyance of water.pptx

Compilation v. interpretation

  • 2. An Interpreter is a Translator Examples of translators: ● Compilers - translates high level code to low level code, e.g. Java -> JVM ● Assemblers - translates assembly language code to machine code, e.g. x86as -> x86 ● High-level translators - translates code from one PL to another, e.g. Java -> C ● Decompilers - translates low-level code to high-level code, e.g. Java JVM bytecode -> Java
  • 3. High Level / Low Level Low High Machine Readable Human Readable Binary: 011011 Grammar: if let, while, for executable Not executable Knows about hardware Does not know about hardware
  • 4. A compiler can be compared to taking a foreign movie and first sub-titling it and then being able to watch it again and again. While an interpreter is like having a translator at the UN translate each line of a delegate’s speech in real- time. AKA... The compiler translates the entire program before it is run. The interpreters translate a line at a time while the program is being run.
  • 6. Compiled Languages Python Javascript Lisp Java ( compiled to byte code first ) C# (compiled to MSIL) PHP Perl Interpreted Languages C C++ Objective-C Swift Fortran
  • 7. Advantages of Compiled Languages - Pre-Compiled binaries are inherently more difficult to reverse-engineer and are therefore helpful to closed-source software providers wishing to keep the I.P. contained in their source code private. - Once a program is translated into native instructions (machine code), it can then be executed over and over again withouth the overhead of this translation. - Ability to support architectures the interpreter hasn't been compiled for (such as embedded systems) - Can be optimized more heavily due to larger window of code to be translated.
  • 8. Advantages of Interpreted Languages - Programs can immediately be executed without the requirement of compiling first. - Potentially has lower memory footprint because no Object Code is created. - Supports portability if interpreter is installed on different platforms. - Starts executing immediately (no compilation phase) - Source Code can be more easily changed between program executions because there is no compilation step in between.
  • 9. Hybrid Approach An interpretive compiler combines fast translation with moderately fast execution, provided that: ● VM code is lower than the source language, but higher than native machine code ● VM instructions have simple formats (can be quickly analysed by an interpreter) Example: JDK provides an interpretive compiler for Java.
  • 11. - any language can be either compiled or interpreted but the implementation of the language is what is either one or both. Sometimes even a spectrum of compiled/interpreted - Etymology - compiler (pile things together, throw in pile), interpreter (inter, between source and assembly) - Interpreted languages require the interpreted to be installed on host machine - Interpreter continues interpreting until it hits an error - Compiler will check errors for you at compilation time - Compiled program requires more memory as all the code is compiled as opposed to line by line discarding the previous line. However with modern computers equipped with gigabytes of ram this isn’t a practical concern. Extra Points