3.2 Programming languages
For programming computers, we want simple, unambiguous, regular, and economical
languages with powerful means of abstraction.
A programming language is a language that is designed to be read and written
by humans to create programs that can be executed by computers.
Programming languages come in many flavors. It is difficult to simultaneously satisfy all
desired properties since simplicity is often at odds with economy.
Every feature that is added to a language to increase its expressiveness incurs a cost in
reducing simplicity and regularity.
For the first two parts of this book, we use the Scheme programming language which
was designed primarily for simplicity.
Another reason there are many different programming languages is that they are
at different levels of abstractionabstraction.
Some languages provide programmers with detailed control over machine
resources, such as selecting a particular location in memory where a value is stored.
Other languages hide most of the details of the machine operation from
the programmer, allowing them to focus on higher-level actions.
Ultimately, we want a program the computer can execute. This means at the lowest level
we need languages the computer can understand directly.
At this level, the program is just a sequence of bits encoding machine instructions. Code
at this level is not easy for humans to understand or write, but it is easy for a processor
to execute quickly.
The machine code encodes instructions that direct the processor to take simple actions
like moving data from one place to another, performing simple arithmetic, and jumping
around to find the next instruction to execute.machine code
For example, the bit sequence 1110101111111110 encodes an instruction in the Intel x86
instruction set (used on most PCs) that instructs the processor to jump backwards two
locations.
Since the instruction itself requires two locations of space, jumping back two locations
actually jumps back to the beginning of this instruction. Hence, the processor gets stuck
running forever without making any progress.
A compiler is a computer program that generates other programs. It translates an input
program written in a high-level language that is easier for humans to create into
a program in a machine-level language that can be executed by the computer.
Admiral Grace Hopper developed the first compilers in the 1950s.
An alternative to a compiler is an interpreter. An interpreter is a tool that
translates between a higher-level language and a lower-level language, but where a
compiler translates an entire program at once and produces a machine language
program that can be executed directly, an interpreter interprets the program a small
piece at a time while it is running.
Nobody believed that I had a running compiler and nobody would touch it. They told
me computers could only do arithmetic.
One disadvantage of using an interpreter instead of a compiler is that because
the translation is happening while the program is running, the program executes
slower than a compiled program.
Another advantage of compilers over interpreters is that since the compiler translates
the entire program it can also analyze the program for consistency and detect certain
types of programming mistakes automatically instead of encountering them when
the program is running (or worse, not detecting them at all and producing
unintended results).
This is especially important when writing critical programs such as flight control
software — we want to detect as many problems as possible in the flight control software
before the plane is flying!
Since we are more concerned with interactive exploration than with performance and
detecting errors early, we use an interpreter instead of a compiler.

More Related Content

PPTX
Computer basics
PPTX
Compiler design slide share
PPTX
Block diagram (computer programming & utilization)
PPTX
Translators(compiler assembler interpretor).
PPT
Language translator
PPTX
Language processors class 3-10
PPTX
Chapter 5
PPT
La 5 Pl Translator
Computer basics
Compiler design slide share
Block diagram (computer programming & utilization)
Translators(compiler assembler interpretor).
Language translator
Language processors class 3-10
Chapter 5
La 5 Pl Translator

What's hot (19)

PPTX
Computer programming project 15sec
PPTX
Planning to computer program(southeast university)
DOC
PDF
Compilation v. interpretation
PPTX
Computer programming
DOCX
Computer assignment for grade 9
PPTX
Language Translator ( Compiler)
PPTX
Translators(Compiler, Assembler) and interpreter
PPTX
Compiler vs interpreter
PDF
Introduction to compiler
PPSX
Ic lecture8
PPT
SD & D High and low level languages
PPTX
Compiler vs interpreter
PPTX
Compiler vs Interpreter-Compiler design ppt.
PPTX
Programming languages
PPTX
Cf&oa
PPTX
10 lesson7
PPT
Lession 6
Computer programming project 15sec
Planning to computer program(southeast university)
Compilation v. interpretation
Computer programming
Computer assignment for grade 9
Language Translator ( Compiler)
Translators(Compiler, Assembler) and interpreter
Compiler vs interpreter
Introduction to compiler
Ic lecture8
SD & D High and low level languages
Compiler vs interpreter
Compiler vs Interpreter-Compiler design ppt.
Programming languages
Cf&oa
10 lesson7
Lession 6
Ad

Similar to programming languages (20)

PPTX
Chapter-4.pptx introduction to computing CC1/L
PPT
Computer languages 11
PDF
2 Programming Language.pdf
PPTX
Data programming with the minimum hocker
PPTX
Agro informatics centre up State of Lec 6.pptx
PPTX
Programming Language
PPTX
Introduction to computer and its fundamentals.pptx
PPTX
Computer-charecteristics,types of languages,translators
PPT
Cmp104 lec 6 computer lang
PPT
Cmp104 lec 6 computer lang
PPT
Programming languages
DOCX
What is a programming language.docx
PPTX
Dion computerprogramming
PPTX
Dion computerprogramming
PPT
Computer languages and generation
PPTX
Define Computer language, Translator, Standard input out C
PDF
C_NOTES.pdf
PPTX
PPTX
Programming language
Chapter-4.pptx introduction to computing CC1/L
Computer languages 11
2 Programming Language.pdf
Data programming with the minimum hocker
Agro informatics centre up State of Lec 6.pptx
Programming Language
Introduction to computer and its fundamentals.pptx
Computer-charecteristics,types of languages,translators
Cmp104 lec 6 computer lang
Cmp104 lec 6 computer lang
Programming languages
What is a programming language.docx
Dion computerprogramming
Dion computerprogramming
Computer languages and generation
Define Computer language, Translator, Standard input out C
C_NOTES.pdf
Programming language
Ad

More from Rajendran (20)

PPT
Element distinctness lower bounds
PPT
Scheduling with Startup and Holding Costs
PPT
Divide and conquer surfing lower bounds
PPT
Red black tree
PPT
Hash table
PPT
Medians and order statistics
PPT
Proof master theorem
PPT
Recursion tree method
PPT
Recurrence theorem
PPT
Master method
PPT
Master method theorem
PPT
Hash tables
PPT
Lower bound
PPT
Master method theorem
PPT
Greedy algorithms
PPT
Longest common subsequences in Algorithm Analysis
PPT
Dynamic programming in Algorithm Analysis
PPT
Average case Analysis of Quicksort
PPT
Np completeness
PPT
computer languages
Element distinctness lower bounds
Scheduling with Startup and Holding Costs
Divide and conquer surfing lower bounds
Red black tree
Hash table
Medians and order statistics
Proof master theorem
Recursion tree method
Recurrence theorem
Master method
Master method theorem
Hash tables
Lower bound
Master method theorem
Greedy algorithms
Longest common subsequences in Algorithm Analysis
Dynamic programming in Algorithm Analysis
Average case Analysis of Quicksort
Np completeness
computer languages

Recently uploaded (20)

PPTX
Introduction to pro and eukaryotes and differences.pptx
PDF
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PPTX
Core Concepts of Personalized Learning and Virtual Learning Environments
PPTX
Module on health assessment of CHN. pptx
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PDF
Uderstanding digital marketing and marketing stratergie for engaging the digi...
PDF
MICROENCAPSULATION_NDDS_BPHARMACY__SEM VII_PCI .pdf
PDF
Hazard Identification & Risk Assessment .pdf
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
PDF
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
PPTX
Computer Architecture Input Output Memory.pptx
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
Environmental Education MCQ BD2EE - Share Source.pdf
Introduction to pro and eukaryotes and differences.pptx
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
AI-driven educational solutions for real-life interventions in the Philippine...
Cambridge-Practice-Tests-for-IELTS-12.docx
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
Core Concepts of Personalized Learning and Virtual Learning Environments
Module on health assessment of CHN. pptx
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
Uderstanding digital marketing and marketing stratergie for engaging the digi...
MICROENCAPSULATION_NDDS_BPHARMACY__SEM VII_PCI .pdf
Hazard Identification & Risk Assessment .pdf
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
Computer Architecture Input Output Memory.pptx
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Environmental Education MCQ BD2EE - Share Source.pdf

programming languages

  • 1. 3.2 Programming languages For programming computers, we want simple, unambiguous, regular, and economical languages with powerful means of abstraction. A programming language is a language that is designed to be read and written by humans to create programs that can be executed by computers. Programming languages come in many flavors. It is difficult to simultaneously satisfy all desired properties since simplicity is often at odds with economy. Every feature that is added to a language to increase its expressiveness incurs a cost in reducing simplicity and regularity. For the first two parts of this book, we use the Scheme programming language which was designed primarily for simplicity. Another reason there are many different programming languages is that they are at different levels of abstractionabstraction. Some languages provide programmers with detailed control over machine resources, such as selecting a particular location in memory where a value is stored. Other languages hide most of the details of the machine operation from the programmer, allowing them to focus on higher-level actions.
  • 2. Ultimately, we want a program the computer can execute. This means at the lowest level we need languages the computer can understand directly. At this level, the program is just a sequence of bits encoding machine instructions. Code at this level is not easy for humans to understand or write, but it is easy for a processor to execute quickly. The machine code encodes instructions that direct the processor to take simple actions like moving data from one place to another, performing simple arithmetic, and jumping around to find the next instruction to execute.machine code For example, the bit sequence 1110101111111110 encodes an instruction in the Intel x86 instruction set (used on most PCs) that instructs the processor to jump backwards two locations. Since the instruction itself requires two locations of space, jumping back two locations actually jumps back to the beginning of this instruction. Hence, the processor gets stuck running forever without making any progress. A compiler is a computer program that generates other programs. It translates an input program written in a high-level language that is easier for humans to create into a program in a machine-level language that can be executed by the computer. Admiral Grace Hopper developed the first compilers in the 1950s. An alternative to a compiler is an interpreter. An interpreter is a tool that translates between a higher-level language and a lower-level language, but where a compiler translates an entire program at once and produces a machine language program that can be executed directly, an interpreter interprets the program a small piece at a time while it is running.
  • 3. Nobody believed that I had a running compiler and nobody would touch it. They told me computers could only do arithmetic. One disadvantage of using an interpreter instead of a compiler is that because the translation is happening while the program is running, the program executes slower than a compiled program. Another advantage of compilers over interpreters is that since the compiler translates the entire program it can also analyze the program for consistency and detect certain types of programming mistakes automatically instead of encountering them when the program is running (or worse, not detecting them at all and producing unintended results). This is especially important when writing critical programs such as flight control software — we want to detect as many problems as possible in the flight control software before the plane is flying! Since we are more concerned with interactive exploration than with performance and detecting errors early, we use an interpreter instead of a compiler.