SlideShare a Scribd company logo
1 of 15
S
CSC 121 Programming 1
Compilers, Interpreters
and Bytecode
What is a Compiler
 A program that translates
(or compiles) a high-level
language into a low-level
language.
What is a
Low-Level Language?
 A low-level language is lower (or
closer) to the CPU and hardware;
 Uses primitive instructions
(binary code) that a machine can
understand, but is more difficult for
humans to read or write.
Low-Level Language
 Examples are Machine code
(closest to hardware – binary code)
 Assembly Language – slightly less
cryptic.
High-Level Language
 A high-level language uses language
that humans can read, understand and
write more easily. Code is compose in a
text/code editor or IDE.
High-Level Language
 Examples of popular high-level
programming languages today are:
C, C++, Java, & Python
 FORTRAN was first
high-level language.
Compiling High-Level Source
Code into Machine Code
 High-level language source code,
written by programmers (using C
or C++) needs to be compiled into
executable machine code.
 A compiler program will translate the
source code into executable binary
code (all at one time).
Compiling High-Level Source
Code into Machine Code
 Programs which need to use a lot of
computer resources, and need to be as
efficient as possible, are often written
in a compiled language like C.
 C in many ways is a lower-level than
Python. For example, a C programmer
needs to handle a lot more memory
management than a Python programmer.
Compiling High-Level Source
Code into Machine Code
 Compiled code is fast and efficient
 But is platform dependent –
meaning it must be compiled
for a particular Operating System
or CPU.
Interpreted
High-Level Source Code
 Languages like Java and Python are
interpreted line by line by an
interpreter before being translated
into code that the CPU can use.
 This takes longer (is slower), but
allows the language to run on
multiple Operating Systems.
Interpreted Languages
 Java and Python source code are
first compiled (translated) into
bytecode which is then executed by
a virtual machine – Java Virtual
Machine or Python Virtual Machine.
 Virtual means it emulates the CPU
or hardware in a sense.
Interpreted Languages
- Python -
Python Interpreter
Inside the
Python Interpreter
Sometimes
referred to as
translator
hello-cpython-36.pyc
hello.py Operating
System
Interpreted Languages - Java
Sources:
 Python Concepts - What is a Python Compiler and
Python Virtual Machine?
(Moondra YouTube Channel)
 Inside Python: What is bytecode and pyc files?
(Indian Pythonista YouTube Channel)
 https://python-textbok.readthedocs.io/

More Related Content

Similar to Programming 1: Compilers, Interpreters & Bytecode

Life cycle of a computer program
Life cycle of a computer programLife cycle of a computer program
Life cycle of a computer programAbhay Kumar
 
Embedded firmware
Embedded firmwareEmbedded firmware
Embedded firmwareJoel P
 
Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)Chao-Lung Yang
 
Describe professional programing languages and talks
Describe professional programing languages and talks Describe professional programing languages and talks
Describe professional programing languages and talks Ed Bray
 
La 5 Pl Translator
La 5   Pl TranslatorLa 5   Pl Translator
La 5 Pl TranslatorCma Mohd
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingNoel Malle
 
2 Programming Language.pdf
2 Programming Language.pdf2 Programming Language.pdf
2 Programming Language.pdfKINGZzofYouTube
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterHossam Hassan
 
Learn c programming language in 24 hours allfreebooks.tk
Learn c programming language in 24 hours   allfreebooks.tkLearn c programming language in 24 hours   allfreebooks.tk
Learn c programming language in 24 hours allfreebooks.tkragulasai
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSsonalikharade3
 
Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic conceptsAbdul Khan
 
Programing language
Programing languagePrograming language
Programing languageJames Taylor
 
Introduction to compiler development
Introduction to compiler developmentIntroduction to compiler development
Introduction to compiler developmentDeepOad
 
Description of programming language
Description of programming languageDescription of programming language
Description of programming languageSam Stratford
 
Language_Processing_System.pptx
Language_Processing_System.pptxLanguage_Processing_System.pptx
Language_Processing_System.pptxMADHURABHOSE
 

Similar to Programming 1: Compilers, Interpreters & Bytecode (20)

Life cycle of a computer program
Life cycle of a computer programLife cycle of a computer program
Life cycle of a computer program
 
Embedded firmware
Embedded firmwareEmbedded firmware
Embedded firmware
 
Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)
 
Describe professional programing languages and talks
Describe professional programing languages and talks Describe professional programing languages and talks
Describe professional programing languages and talks
 
La 5 Pl Translator
La 5   Pl TranslatorLa 5   Pl Translator
La 5 Pl Translator
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
An introduction to Reverse Engineering
An introduction to Reverse EngineeringAn introduction to Reverse Engineering
An introduction to Reverse Engineering
 
2 Programming Language.pdf
2 Programming Language.pdf2 Programming Language.pdf
2 Programming Language.pdf
 
Computer languages
Computer languagesComputer languages
Computer languages
 
Compilers
CompilersCompilers
Compilers
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
 
Learn c programming language in 24 hours allfreebooks.tk
Learn c programming language in 24 hours   allfreebooks.tkLearn c programming language in 24 hours   allfreebooks.tk
Learn c programming language in 24 hours allfreebooks.tk
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONS
 
Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic concepts
 
class1.pdf
class1.pdfclass1.pdf
class1.pdf
 
Programing language
Programing languagePrograming language
Programing language
 
Introduction to compiler development
Introduction to compiler developmentIntroduction to compiler development
Introduction to compiler development
 
Description of programming language
Description of programming languageDescription of programming language
Description of programming language
 
Language_Processing_System.pptx
Language_Processing_System.pptxLanguage_Processing_System.pptx
Language_Processing_System.pptx
 

More from Richard Homa

CSC103 Digital Security
CSC103 Digital SecurityCSC103 Digital Security
CSC103 Digital SecurityRichard Homa
 
CSC 103 Databases Overview
CSC 103 Databases OverviewCSC 103 Databases Overview
CSC 103 Databases OverviewRichard Homa
 
CSC103 Intro to Programming
CSC103 Intro to ProgrammingCSC103 Intro to Programming
CSC103 Intro to ProgrammingRichard Homa
 
CSC103 Gaming Overview (for Everyone)
CSC103 Gaming Overview (for Everyone)CSC103 Gaming Overview (for Everyone)
CSC103 Gaming Overview (for Everyone)Richard Homa
 
CSC103 3D Software & Technology
CSC103 3D Software & TechnologyCSC103 3D Software & Technology
CSC103 3D Software & TechnologyRichard Homa
 
CSC103 Vector vs Raster Graphics
CSC103 Vector vs Raster GraphicsCSC103 Vector vs Raster Graphics
CSC103 Vector vs Raster GraphicsRichard Homa
 
CSC103 Bits, Bytes & Binary
CSC103 Bits, Bytes & BinaryCSC103 Bits, Bytes & Binary
CSC103 Bits, Bytes & BinaryRichard Homa
 
CSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JSCSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JSRichard Homa
 
CSC103 Processing, Memory & Storage
CSC103 Processing, Memory & StorageCSC103 Processing, Memory & Storage
CSC103 Processing, Memory & StorageRichard Homa
 
CSC103 Digital Devices: Device Basics
CSC103 Digital Devices: Device BasicsCSC103 Digital Devices: Device Basics
CSC103 Digital Devices: Device BasicsRichard Homa
 
CCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, BinaryCCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, BinaryRichard Homa
 
CSC103 Digital Images, Pixels, RGB Colors
CSC103 Digital Images, Pixels, RGB ColorsCSC103 Digital Images, Pixels, RGB Colors
CSC103 Digital Images, Pixels, RGB ColorsRichard Homa
 
CSC102 Excel Basics
CSC102 Excel BasicsCSC102 Excel Basics
CSC102 Excel BasicsRichard Homa
 
CSC102 Word Paragraph Formatting
CSC102 Word Paragraph FormattingCSC102 Word Paragraph Formatting
CSC102 Word Paragraph FormattingRichard Homa
 
CSC102 Computer Software
CSC102 Computer SoftwareCSC102 Computer Software
CSC102 Computer SoftwareRichard Homa
 
CSC102 Computer Connectivity
CSC102 Computer ConnectivityCSC102 Computer Connectivity
CSC102 Computer ConnectivityRichard Homa
 
CSC 102 Computer Intro
CSC 102 Computer IntroCSC 102 Computer Intro
CSC 102 Computer IntroRichard Homa
 
Creating Immersive Technology Experiences with Web-based Software & Resources
Creating Immersive Technology Experiences with Web-based Software & ResourcesCreating Immersive Technology Experiences with Web-based Software & Resources
Creating Immersive Technology Experiences with Web-based Software & ResourcesRichard Homa
 

More from Richard Homa (20)

CSC103 Digital Security
CSC103 Digital SecurityCSC103 Digital Security
CSC103 Digital Security
 
CSC 103 Databases Overview
CSC 103 Databases OverviewCSC 103 Databases Overview
CSC 103 Databases Overview
 
CSC103 Intro to Programming
CSC103 Intro to ProgrammingCSC103 Intro to Programming
CSC103 Intro to Programming
 
CSC103 Gaming Overview (for Everyone)
CSC103 Gaming Overview (for Everyone)CSC103 Gaming Overview (for Everyone)
CSC103 Gaming Overview (for Everyone)
 
CSC103 3D Software & Technology
CSC103 3D Software & TechnologyCSC103 3D Software & Technology
CSC103 3D Software & Technology
 
CSC103 Vector vs Raster Graphics
CSC103 Vector vs Raster GraphicsCSC103 Vector vs Raster Graphics
CSC103 Vector vs Raster Graphics
 
CSC103 Bits, Bytes & Binary
CSC103 Bits, Bytes & BinaryCSC103 Bits, Bytes & Binary
CSC103 Bits, Bytes & Binary
 
CSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JSCSC103 Web Technologies: HTML, CSS, JS
CSC103 Web Technologies: HTML, CSS, JS
 
CSC103 Processing, Memory & Storage
CSC103 Processing, Memory & StorageCSC103 Processing, Memory & Storage
CSC103 Processing, Memory & Storage
 
CSC103 Digital Devices: Device Basics
CSC103 Digital Devices: Device BasicsCSC103 Digital Devices: Device Basics
CSC103 Digital Devices: Device Basics
 
CSC103 Internet
CSC103 InternetCSC103 Internet
CSC103 Internet
 
CCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, BinaryCCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, Binary
 
CSC103 Digital Images, Pixels, RGB Colors
CSC103 Digital Images, Pixels, RGB ColorsCSC103 Digital Images, Pixels, RGB Colors
CSC103 Digital Images, Pixels, RGB Colors
 
Excel Review Quiz
Excel Review QuizExcel Review Quiz
Excel Review Quiz
 
CSC102 Excel Basics
CSC102 Excel BasicsCSC102 Excel Basics
CSC102 Excel Basics
 
CSC102 Word Paragraph Formatting
CSC102 Word Paragraph FormattingCSC102 Word Paragraph Formatting
CSC102 Word Paragraph Formatting
 
CSC102 Computer Software
CSC102 Computer SoftwareCSC102 Computer Software
CSC102 Computer Software
 
CSC102 Computer Connectivity
CSC102 Computer ConnectivityCSC102 Computer Connectivity
CSC102 Computer Connectivity
 
CSC 102 Computer Intro
CSC 102 Computer IntroCSC 102 Computer Intro
CSC 102 Computer Intro
 
Creating Immersive Technology Experiences with Web-based Software & Resources
Creating Immersive Technology Experiences with Web-based Software & ResourcesCreating Immersive Technology Experiences with Web-based Software & Resources
Creating Immersive Technology Experiences with Web-based Software & Resources
 

Recently uploaded

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

Programming 1: Compilers, Interpreters & Bytecode

  • 1. S CSC 121 Programming 1 Compilers, Interpreters and Bytecode
  • 2. What is a Compiler  A program that translates (or compiles) a high-level language into a low-level language.
  • 3. What is a Low-Level Language?  A low-level language is lower (or closer) to the CPU and hardware;  Uses primitive instructions (binary code) that a machine can understand, but is more difficult for humans to read or write.
  • 4. Low-Level Language  Examples are Machine code (closest to hardware – binary code)  Assembly Language – slightly less cryptic.
  • 5. High-Level Language  A high-level language uses language that humans can read, understand and write more easily. Code is compose in a text/code editor or IDE.
  • 6. High-Level Language  Examples of popular high-level programming languages today are: C, C++, Java, & Python  FORTRAN was first high-level language.
  • 7. Compiling High-Level Source Code into Machine Code  High-level language source code, written by programmers (using C or C++) needs to be compiled into executable machine code.  A compiler program will translate the source code into executable binary code (all at one time).
  • 8. Compiling High-Level Source Code into Machine Code  Programs which need to use a lot of computer resources, and need to be as efficient as possible, are often written in a compiled language like C.  C in many ways is a lower-level than Python. For example, a C programmer needs to handle a lot more memory management than a Python programmer.
  • 9. Compiling High-Level Source Code into Machine Code  Compiled code is fast and efficient  But is platform dependent – meaning it must be compiled for a particular Operating System or CPU.
  • 10. Interpreted High-Level Source Code  Languages like Java and Python are interpreted line by line by an interpreter before being translated into code that the CPU can use.  This takes longer (is slower), but allows the language to run on multiple Operating Systems.
  • 11. Interpreted Languages  Java and Python source code are first compiled (translated) into bytecode which is then executed by a virtual machine – Java Virtual Machine or Python Virtual Machine.  Virtual means it emulates the CPU or hardware in a sense.
  • 12. Interpreted Languages - Python - Python Interpreter
  • 13. Inside the Python Interpreter Sometimes referred to as translator hello-cpython-36.pyc hello.py Operating System
  • 15. Sources:  Python Concepts - What is a Python Compiler and Python Virtual Machine? (Moondra YouTube Channel)  Inside Python: What is bytecode and pyc files? (Indian Pythonista YouTube Channel)  https://python-textbok.readthedocs.io/