SlideShare a Scribd company logo
ISBN 0-321-49362-1
Chapter 1
Preliminaries
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-2
Chapter 1 Topics
• Reasons for Studying Concepts of
Programming Languages
• Programming Domains
• Language Evaluation Criteria
• Influences on Language Design
• Language Categories
• Language Design Trade-Offs
• Implementation Methods
• Programming Environments
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-3
Reasons for Studying Concepts of
Programming Languages
• Increased ability to express ideas
• Improved background for choosing
appropriate languages
• Increased ability to learn new languages
• Better understanding of significance of
implementation
• Better use of languages that are already
known
• Overall advancement of computing
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-4
Programming Domains
• Scientific applications
– Large numbers of floating point computations; use of arrays
– Fortran
• Business applications
– Produce reports, use decimal numbers and characters
– COBOL
• Artificial intelligence
– Symbols rather than numbers manipulated; use of linked lists
– LISP
• Systems programming
– Need efficiency because of continuous use
– C
• Web Software
– Eclectic collection of languages: markup (e.g., XHTML), scripting
(e.g., PHP), general-purpose (e.g., Java)
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-5
Language Evaluation Criteria
• Readability: the ease with which programs
can be read and understood
• Writability: the ease with which a language
can be used to create programs
• Reliability: conformance to specifications
(i.e., performs to its specifications)
• Cost: the ultimate total cost
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-6
Evaluation Criteria: Readability
• Overall simplicity
– A manageable set of features and constructs
– Minimal feature multiplicity
– Minimal operator overloading
• Orthogonality
– A relatively small set of primitive constructs can be combined in a relatively
small number of ways
– Every possible combination is legal
• Control statements
– The presence of well-known control structures
• Data types and structures
– Adequate predefined data types and structures
– The presence of adequate facilities for defining data structures
• Syntax considerations
– Identifier forms: flexible composition
– Special words and methods of forming compound statements
– Form and meaning: self-descriptive constructs, meaningful keywords
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-7
Evaluation Criteria: Writability
• Simplicity and orthogonality
– Few constructs, a small number of primitives, a small set of rules
for combining them
• Support for abstraction
– The ability to define and use complex structures or operations in
ways that allow details to be ignored
• Expressivity
– A set of relatively convenient ways of specifying operations
– Strength and number of operators and predefined functions
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-8
Evaluation Criteria: Reliability
• Type checking
– Testing for type errors
• Exception handling
– Intercept run-time errors and take corrective measures
• Aliasing
– Presence of two or more distinct referencing methods for the same
memory location
• Readability and writability
– A language that does not support “natural” ways of expressing an
algorithm will require the use of “unnatural” approaches, and hence
reduced reliability
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-9
Evaluation Criteria: Cost
• Training programmers to use the language
• Writing programs (closeness to particular
applications)
• Compiling programs
• Executing programs
• Language implementation system: availability
of free compilers
• Reliability: poor reliability leads to high costs
• Maintaining programs
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-10
Evaluation Criteria: Others
• Portability
– The ease with which programs can be moved from
one implementation to another
• Generality
– The applicability to a wide range of applications
• Well-definedness
– The completeness and precision of the language’s
official definition
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-11
Influences on Language Design
• Computer Architecture
– Languages are developed around the prevalent
computer architecture, known as the von Neumann
architecture
• Programming Methodologies
– New software development methodologies (e.g.,
object-oriented software development) led to new
programming paradigms and by extension, new
programming languages
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-12
Computer Architecture Influence
• Well-known computer architecture: Von Neumann
• Imperative languages, most dominant, because of von
Neumann computers
– Data and programs stored in memory
– Memory is separate from CPU
– Instructions and data are piped from memory to CPU
– Basis for imperative languages
• Variables model memory cells
• Assignment statements model piping
• Iteration is efficient
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-13
The von Neumann Architecture
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-14
The von Neumann Architecture
• Fetch-execute-cycle (on a von Neumann
architecture computer)
initialize the program counter
repeat forever
fetch the instruction pointed by the counter
increment the counter
decode the instruction
execute the instruction
end repeat
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-15
Programming Methodologies Influences
• 1950s and early 1960s: Simple applications; worry
about machine efficiency
• Late 1960s: People efficiency became important;
readability, better control structures
– structured programming
– top-down design and step-wise refinement
• Late 1970s: Process-oriented to data-oriented
– data abstraction
• Middle 1980s: Object-oriented programming
– Data abstraction + inheritance + polymorphism
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-16
Language Categories
• Imperative
– Central features are variables, assignment statements, and iteration
– Include languages that support object-oriented programming
– Include scripting languages
– Include the visual languages
– Examples: C, Java, Perl, JavaScript, Visual BASIC .NET, C++
• Functional
– Main means of making computations is by applying functions to given
parameters
– Examples: LISP, Scheme
• Logic
– Rule-based (rules are specified in no particular order)
– Example: Prolog
• Markup/programming hybrid
– Markup languages extended to support some programming
– Examples: JSTL, XSLT
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-17
Language Design Trade-Offs
• Reliability vs. cost of execution
– Example: Java demands all references to array elements be
checked for proper indexing, which leads to increased
execution costs
• Readability vs. writability
Example: APL provides many powerful operators (and a large
number of new symbols), allowing complex computations to be
written in a compact program but at the cost of poor readability
• Writability (flexibility) vs. reliability
– Example: C++ pointers are powerful and very flexible but are
unreliable
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-18
Implementation Methods
• Compilation
– Programs are translated into machine language
• Pure Interpretation
– Programs are interpreted by another program known as an
interpreter
• Hybrid Implementation Systems
– A compromise between compilers and pure interpreters
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-19
Layered View of Computer
The operating system and
language implementation
are layered over
machine interface of a
computer
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-20
Compilation
• Translate high-level program (source language) into
machine code (machine language)
• Slow translation, fast execution
• Compilation process has several phases:
– lexical analysis: converts characters in the source program into
lexical units
– syntax analysis: transforms lexical units into parse trees which
represent the syntactic structure of program
– Semantics analysis: generate intermediate code
– code generation: machine code is generated
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-21
The Compilation Process
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-22
Additional Compilation Terminologies
• Load module (executable image): the user
and system code together
• Linking and loading: the process of
collecting system program units and linking
them to a user program
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-23
Von Neumann Bottleneck
• Connection speed between a computer’s
memory and its processor determines the speed
of a computer
• Program instructions often can be executed
much faster than the speed of the connection;
the connection speed thus results in a
bottleneck
• Known as the von Neumann bottleneck; it is the
primary limiting factor in the speed of computers
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-24
Pure Interpretation
• No translation
• Easier implementation of programs (run-time errors can
easily and immediately be displayed)
• Slower execution (10 to 100 times slower than compiled
programs)
• Often requires more space
• Now rare for traditional high-level languages
• Significant comeback with some Web scripting
languages (e.g., JavaScript, PHP)
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-25
Pure Interpretation Process
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-26
Hybrid Implementation Systems
• A compromise between compilers and pure
interpreters
• A high-level language program is translated to
an intermediate language that allows easy
interpretation
• Faster than pure interpretation
• Examples
– Perl programs are partially compiled to detect errors before
interpretation
– Initial implementations of Java were hybrid; the intermediate
form, byte code, provides portability to any machine that has a
byte code interpreter and a run-time system (together, these are
called Java Virtual Machine)
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-27
Hybrid Implementation Process
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-28
Just-in-Time Implementation Systems
• Initially translate programs to an intermediate language
• Then compile the intermediate language of the
subprograms into machine code when they are called
• Machine code version is kept for subsequent calls
• JIT systems are widely used for Java programs
• .NET languages are implemented with a JIT system
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-29
Preprocessors
• Preprocessor macros (instructions) are
commonly used to specify that code from
another file is to be included
• A preprocessor processes a program
immediately before the program is compiled to
expand embedded preprocessor macros
• A well-known example: C preprocessor
– expands #include, #define, and similar macros
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-30
Programming Environments
• The collection of tools used in software development
• UNIX
– An older operating system and tool collection
– Nowadays often used through a GUI (e.g., CDE, KDE, or
GNOME) that runs on top of UNIX
• Borland JBuilder
– An integrated development environment for Java
• Microsoft Visual Studio.NET
– A large, complex visual environment
– Used to program in C#, Visual BASIC.NET, Jscript, J#, and C++
Copyright © 2007 Addison-
Wesley. All rights reserved. 1-31
Summary
• The study of programming languages is valuable for a
number of reasons:
– Increase our capacity to use different constructs
– Enable us to choose languages more intelligently
– Makes learning new languages easier
• Most important criteria for evaluating programming
languages include:
– Readability, writability, reliability, cost
• Major influences on language design have been machine
architecture and software development methodologies
• The major methods of implementing programming
languages are: compilation, pure interpretation, and
hybrid implementation

More Related Content

What's hot

Cd ch1 - introduction
Cd   ch1 - introductionCd   ch1 - introduction
Cd ch1 - introduction
mengistu23
 
Principles of programming languages. Detail notes
Principles of programming languages. Detail notesPrinciples of programming languages. Detail notes
Principles of programming languages. Detail notes
VIKAS SINGH BHADOURIA
 
Introduction to course
Introduction to courseIntroduction to course
Introduction to course
nikit meshram
 
Syntax directed-translation
Syntax directed-translationSyntax directed-translation
Syntax directed-translation
Junaid Lodhi
 
Ch1 language design issue
Ch1 language design issueCh1 language design issue
Ch1 language design issue
Jigisha Pandya
 
Introduction to Compilers
Introduction to CompilersIntroduction to Compilers
Introduction to Compilers
Akhil Kaushik
 
3 describing syntax
3 describing syntax3 describing syntax
3 describing syntax
Munawar Ahmed
 
System Programming Unit III
System Programming Unit IIISystem Programming Unit III
System Programming Unit IIIManoj Patil
 
System Programming Overview
System Programming OverviewSystem Programming Overview
System Programming Overview
Dattatray Gandhmal
 
Compiler Design Lecture Notes
Compiler Design Lecture NotesCompiler Design Lecture Notes
Compiler Design Lecture Notes
FellowBuddy.com
 
Cs111 ch01 v4
Cs111 ch01 v4Cs111 ch01 v4
Cs111 ch01 v4
ArnoldNarte
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processors
Rebaz Najeeb
 
Compiler Design
Compiler DesignCompiler Design
Compiler DesignMir Majid
 
Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3Akshay Nagpurkar
 
Compiler design Introduction
Compiler design IntroductionCompiler design Introduction
Compiler design Introduction
Aman Sharma
 
Techniques & applications of Compiler
Techniques & applications of CompilerTechniques & applications of Compiler
Techniques & applications of Compiler
Preethi AKNR
 
Introduction to programming principles languages
Introduction to programming principles languagesIntroduction to programming principles languages
Introduction to programming principles languages
Frankie Jones
 
Introduction to Computers, the Internet and the Web
Introduction to Computers, the Internet and the WebIntroduction to Computers, the Internet and the Web
Introduction to Computers, the Internet and the Web
Andy Juan Sarango Veliz
 

What's hot (18)

Cd ch1 - introduction
Cd   ch1 - introductionCd   ch1 - introduction
Cd ch1 - introduction
 
Principles of programming languages. Detail notes
Principles of programming languages. Detail notesPrinciples of programming languages. Detail notes
Principles of programming languages. Detail notes
 
Introduction to course
Introduction to courseIntroduction to course
Introduction to course
 
Syntax directed-translation
Syntax directed-translationSyntax directed-translation
Syntax directed-translation
 
Ch1 language design issue
Ch1 language design issueCh1 language design issue
Ch1 language design issue
 
Introduction to Compilers
Introduction to CompilersIntroduction to Compilers
Introduction to Compilers
 
3 describing syntax
3 describing syntax3 describing syntax
3 describing syntax
 
System Programming Unit III
System Programming Unit IIISystem Programming Unit III
System Programming Unit III
 
System Programming Overview
System Programming OverviewSystem Programming Overview
System Programming Overview
 
Compiler Design Lecture Notes
Compiler Design Lecture NotesCompiler Design Lecture Notes
Compiler Design Lecture Notes
 
Cs111 ch01 v4
Cs111 ch01 v4Cs111 ch01 v4
Cs111 ch01 v4
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processors
 
Compiler Design
Compiler DesignCompiler Design
Compiler Design
 
Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3
 
Compiler design Introduction
Compiler design IntroductionCompiler design Introduction
Compiler design Introduction
 
Techniques & applications of Compiler
Techniques & applications of CompilerTechniques & applications of Compiler
Techniques & applications of Compiler
 
Introduction to programming principles languages
Introduction to programming principles languagesIntroduction to programming principles languages
Introduction to programming principles languages
 
Introduction to Computers, the Internet and the Web
Introduction to Computers, the Internet and the WebIntroduction to Computers, the Internet and the Web
Introduction to Computers, the Internet and the Web
 

Viewers also liked

8 statement level
8 statement level8 statement level
8 statement level
Munawar Ahmed
 
9 subprograms
9 subprograms9 subprograms
9 subprograms
Munawar Ahmed
 
Java Variable Storage
Java Variable StorageJava Variable Storage
Java Variable Storage
Shahid Rasheed
 
4 lexical and syntax
4 lexical and syntax4 lexical and syntax
4 lexical and syntax
Munawar Ahmed
 
2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare
SlideShare
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShare
SlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
SlideShare
 

Viewers also liked (7)

8 statement level
8 statement level8 statement level
8 statement level
 
9 subprograms
9 subprograms9 subprograms
9 subprograms
 
Java Variable Storage
Java Variable StorageJava Variable Storage
Java Variable Storage
 
4 lexical and syntax
4 lexical and syntax4 lexical and syntax
4 lexical and syntax
 
2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Similar to CH # 1 preliminaries

computer-science_engineering_principles-of-programming-languages_introduction...
computer-science_engineering_principles-of-programming-languages_introduction...computer-science_engineering_principles-of-programming-languages_introduction...
computer-science_engineering_principles-of-programming-languages_introduction...
AshutoshSharma874829
 
Unit 1
Unit 1Unit 1
Unit 1_Evaluation Criteria_session 3.pptx
Unit 1_Evaluation Criteria_session 3.pptxUnit 1_Evaluation Criteria_session 3.pptx
Unit 1_Evaluation Criteria_session 3.pptx
Asst.prof M.Gokilavani
 
Ppl 13 july2019
Ppl 13 july2019Ppl 13 july2019
Ppl 13 july2019
Khurram Tehseen
 
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Professor Lili Saghafi
 
C programming Introduction
C programming IntroductionC programming Introduction
C programming Introduction
Srinivas Dr. Suri
 
Compilers.pptx
Compilers.pptxCompilers.pptx
Compilers.pptx
MohammedMohammed578197
 
Management information system software
Management information system softwareManagement information system software
Management information system software
Online
 
Chtp4 01
Chtp4 01Chtp4 01
Chtp4 01
manedar
 
INTRODUCTION TO COMPUTER SOFTWARE
INTRODUCTION TO COMPUTER SOFTWAREINTRODUCTION TO COMPUTER SOFTWARE
INTRODUCTION TO COMPUTER SOFTWARE
abiramiabi21
 
Cochrane von Suchodoletz File Creation, Rendering and Formats
Cochrane von Suchodoletz File Creation, Rendering and FormatsCochrane von Suchodoletz File Creation, Rendering and Formats
Cochrane von Suchodoletz File Creation, Rendering and Formats
Future Perfect 2012
 
Lecture 9: Dynamic web application
Lecture 9: Dynamic web applicationLecture 9: Dynamic web application
Lecture 9: Dynamic web application
Artificial Intelligence Institute at UofSC
 
Problem Solving and Program Design in C_1.pdf
Problem Solving and Program Design in C_1.pdfProblem Solving and Program Design in C_1.pdf
Problem Solving and Program Design in C_1.pdf
jlu08167
 
Evalution about programming language part 1
Evalution about programming language part 1Evalution about programming language part 1
Evalution about programming language part 1
Synapseindiappsdevelopment
 
Embedded 100912065920-phpapp02
Embedded 100912065920-phpapp02Embedded 100912065920-phpapp02
Embedded 100912065920-phpapp02
Atv Reddy
 
Embedded 100912065920-phpapp02
Embedded 100912065920-phpapp02Embedded 100912065920-phpapp02
Embedded 100912065920-phpapp02Atv Reddy
 
8505548.ppt
8505548.ppt8505548.ppt
8505548.ppt
meenabairagi1
 
Hpc 6 7
Hpc 6 7Hpc 6 7
Hpc 6 7
Yasir Khan
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming languageVasavi College of Engg
 

Similar to CH # 1 preliminaries (20)

computer-science_engineering_principles-of-programming-languages_introduction...
computer-science_engineering_principles-of-programming-languages_introduction...computer-science_engineering_principles-of-programming-languages_introduction...
computer-science_engineering_principles-of-programming-languages_introduction...
 
Unit 1
Unit 1Unit 1
Unit 1
 
Unit 1_Evaluation Criteria_session 3.pptx
Unit 1_Evaluation Criteria_session 3.pptxUnit 1_Evaluation Criteria_session 3.pptx
Unit 1_Evaluation Criteria_session 3.pptx
 
Ppl 13 july2019
Ppl 13 july2019Ppl 13 july2019
Ppl 13 july2019
 
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
Programming Languages Categories / Programming Paradigm By: Prof. Lili Saghafi
 
C programming Introduction
C programming IntroductionC programming Introduction
C programming Introduction
 
Compilers.pptx
Compilers.pptxCompilers.pptx
Compilers.pptx
 
Management information system software
Management information system softwareManagement information system software
Management information system software
 
Chtp401
Chtp401Chtp401
Chtp401
 
Chtp4 01
Chtp4 01Chtp4 01
Chtp4 01
 
INTRODUCTION TO COMPUTER SOFTWARE
INTRODUCTION TO COMPUTER SOFTWAREINTRODUCTION TO COMPUTER SOFTWARE
INTRODUCTION TO COMPUTER SOFTWARE
 
Cochrane von Suchodoletz File Creation, Rendering and Formats
Cochrane von Suchodoletz File Creation, Rendering and FormatsCochrane von Suchodoletz File Creation, Rendering and Formats
Cochrane von Suchodoletz File Creation, Rendering and Formats
 
Lecture 9: Dynamic web application
Lecture 9: Dynamic web applicationLecture 9: Dynamic web application
Lecture 9: Dynamic web application
 
Problem Solving and Program Design in C_1.pdf
Problem Solving and Program Design in C_1.pdfProblem Solving and Program Design in C_1.pdf
Problem Solving and Program Design in C_1.pdf
 
Evalution about programming language part 1
Evalution about programming language part 1Evalution about programming language part 1
Evalution about programming language part 1
 
Embedded 100912065920-phpapp02
Embedded 100912065920-phpapp02Embedded 100912065920-phpapp02
Embedded 100912065920-phpapp02
 
Embedded 100912065920-phpapp02
Embedded 100912065920-phpapp02Embedded 100912065920-phpapp02
Embedded 100912065920-phpapp02
 
8505548.ppt
8505548.ppt8505548.ppt
8505548.ppt
 
Hpc 6 7
Hpc 6 7Hpc 6 7
Hpc 6 7
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
 

Recently uploaded

Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 

Recently uploaded (20)

Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 

CH # 1 preliminaries

  • 2. Copyright © 2007 Addison- Wesley. All rights reserved. 1-2 Chapter 1 Topics • Reasons for Studying Concepts of Programming Languages • Programming Domains • Language Evaluation Criteria • Influences on Language Design • Language Categories • Language Design Trade-Offs • Implementation Methods • Programming Environments
  • 3. Copyright © 2007 Addison- Wesley. All rights reserved. 1-3 Reasons for Studying Concepts of Programming Languages • Increased ability to express ideas • Improved background for choosing appropriate languages • Increased ability to learn new languages • Better understanding of significance of implementation • Better use of languages that are already known • Overall advancement of computing
  • 4. Copyright © 2007 Addison- Wesley. All rights reserved. 1-4 Programming Domains • Scientific applications – Large numbers of floating point computations; use of arrays – Fortran • Business applications – Produce reports, use decimal numbers and characters – COBOL • Artificial intelligence – Symbols rather than numbers manipulated; use of linked lists – LISP • Systems programming – Need efficiency because of continuous use – C • Web Software – Eclectic collection of languages: markup (e.g., XHTML), scripting (e.g., PHP), general-purpose (e.g., Java)
  • 5. Copyright © 2007 Addison- Wesley. All rights reserved. 1-5 Language Evaluation Criteria • Readability: the ease with which programs can be read and understood • Writability: the ease with which a language can be used to create programs • Reliability: conformance to specifications (i.e., performs to its specifications) • Cost: the ultimate total cost
  • 6. Copyright © 2007 Addison- Wesley. All rights reserved. 1-6 Evaluation Criteria: Readability • Overall simplicity – A manageable set of features and constructs – Minimal feature multiplicity – Minimal operator overloading • Orthogonality – A relatively small set of primitive constructs can be combined in a relatively small number of ways – Every possible combination is legal • Control statements – The presence of well-known control structures • Data types and structures – Adequate predefined data types and structures – The presence of adequate facilities for defining data structures • Syntax considerations – Identifier forms: flexible composition – Special words and methods of forming compound statements – Form and meaning: self-descriptive constructs, meaningful keywords
  • 7. Copyright © 2007 Addison- Wesley. All rights reserved. 1-7 Evaluation Criteria: Writability • Simplicity and orthogonality – Few constructs, a small number of primitives, a small set of rules for combining them • Support for abstraction – The ability to define and use complex structures or operations in ways that allow details to be ignored • Expressivity – A set of relatively convenient ways of specifying operations – Strength and number of operators and predefined functions
  • 8. Copyright © 2007 Addison- Wesley. All rights reserved. 1-8 Evaluation Criteria: Reliability • Type checking – Testing for type errors • Exception handling – Intercept run-time errors and take corrective measures • Aliasing – Presence of two or more distinct referencing methods for the same memory location • Readability and writability – A language that does not support “natural” ways of expressing an algorithm will require the use of “unnatural” approaches, and hence reduced reliability
  • 9. Copyright © 2007 Addison- Wesley. All rights reserved. 1-9 Evaluation Criteria: Cost • Training programmers to use the language • Writing programs (closeness to particular applications) • Compiling programs • Executing programs • Language implementation system: availability of free compilers • Reliability: poor reliability leads to high costs • Maintaining programs
  • 10. Copyright © 2007 Addison- Wesley. All rights reserved. 1-10 Evaluation Criteria: Others • Portability – The ease with which programs can be moved from one implementation to another • Generality – The applicability to a wide range of applications • Well-definedness – The completeness and precision of the language’s official definition
  • 11. Copyright © 2007 Addison- Wesley. All rights reserved. 1-11 Influences on Language Design • Computer Architecture – Languages are developed around the prevalent computer architecture, known as the von Neumann architecture • Programming Methodologies – New software development methodologies (e.g., object-oriented software development) led to new programming paradigms and by extension, new programming languages
  • 12. Copyright © 2007 Addison- Wesley. All rights reserved. 1-12 Computer Architecture Influence • Well-known computer architecture: Von Neumann • Imperative languages, most dominant, because of von Neumann computers – Data and programs stored in memory – Memory is separate from CPU – Instructions and data are piped from memory to CPU – Basis for imperative languages • Variables model memory cells • Assignment statements model piping • Iteration is efficient
  • 13. Copyright © 2007 Addison- Wesley. All rights reserved. 1-13 The von Neumann Architecture
  • 14. Copyright © 2007 Addison- Wesley. All rights reserved. 1-14 The von Neumann Architecture • Fetch-execute-cycle (on a von Neumann architecture computer) initialize the program counter repeat forever fetch the instruction pointed by the counter increment the counter decode the instruction execute the instruction end repeat
  • 15. Copyright © 2007 Addison- Wesley. All rights reserved. 1-15 Programming Methodologies Influences • 1950s and early 1960s: Simple applications; worry about machine efficiency • Late 1960s: People efficiency became important; readability, better control structures – structured programming – top-down design and step-wise refinement • Late 1970s: Process-oriented to data-oriented – data abstraction • Middle 1980s: Object-oriented programming – Data abstraction + inheritance + polymorphism
  • 16. Copyright © 2007 Addison- Wesley. All rights reserved. 1-16 Language Categories • Imperative – Central features are variables, assignment statements, and iteration – Include languages that support object-oriented programming – Include scripting languages – Include the visual languages – Examples: C, Java, Perl, JavaScript, Visual BASIC .NET, C++ • Functional – Main means of making computations is by applying functions to given parameters – Examples: LISP, Scheme • Logic – Rule-based (rules are specified in no particular order) – Example: Prolog • Markup/programming hybrid – Markup languages extended to support some programming – Examples: JSTL, XSLT
  • 17. Copyright © 2007 Addison- Wesley. All rights reserved. 1-17 Language Design Trade-Offs • Reliability vs. cost of execution – Example: Java demands all references to array elements be checked for proper indexing, which leads to increased execution costs • Readability vs. writability Example: APL provides many powerful operators (and a large number of new symbols), allowing complex computations to be written in a compact program but at the cost of poor readability • Writability (flexibility) vs. reliability – Example: C++ pointers are powerful and very flexible but are unreliable
  • 18. Copyright © 2007 Addison- Wesley. All rights reserved. 1-18 Implementation Methods • Compilation – Programs are translated into machine language • Pure Interpretation – Programs are interpreted by another program known as an interpreter • Hybrid Implementation Systems – A compromise between compilers and pure interpreters
  • 19. Copyright © 2007 Addison- Wesley. All rights reserved. 1-19 Layered View of Computer The operating system and language implementation are layered over machine interface of a computer
  • 20. Copyright © 2007 Addison- Wesley. All rights reserved. 1-20 Compilation • Translate high-level program (source language) into machine code (machine language) • Slow translation, fast execution • Compilation process has several phases: – lexical analysis: converts characters in the source program into lexical units – syntax analysis: transforms lexical units into parse trees which represent the syntactic structure of program – Semantics analysis: generate intermediate code – code generation: machine code is generated
  • 21. Copyright © 2007 Addison- Wesley. All rights reserved. 1-21 The Compilation Process
  • 22. Copyright © 2007 Addison- Wesley. All rights reserved. 1-22 Additional Compilation Terminologies • Load module (executable image): the user and system code together • Linking and loading: the process of collecting system program units and linking them to a user program
  • 23. Copyright © 2007 Addison- Wesley. All rights reserved. 1-23 Von Neumann Bottleneck • Connection speed between a computer’s memory and its processor determines the speed of a computer • Program instructions often can be executed much faster than the speed of the connection; the connection speed thus results in a bottleneck • Known as the von Neumann bottleneck; it is the primary limiting factor in the speed of computers
  • 24. Copyright © 2007 Addison- Wesley. All rights reserved. 1-24 Pure Interpretation • No translation • Easier implementation of programs (run-time errors can easily and immediately be displayed) • Slower execution (10 to 100 times slower than compiled programs) • Often requires more space • Now rare for traditional high-level languages • Significant comeback with some Web scripting languages (e.g., JavaScript, PHP)
  • 25. Copyright © 2007 Addison- Wesley. All rights reserved. 1-25 Pure Interpretation Process
  • 26. Copyright © 2007 Addison- Wesley. All rights reserved. 1-26 Hybrid Implementation Systems • A compromise between compilers and pure interpreters • A high-level language program is translated to an intermediate language that allows easy interpretation • Faster than pure interpretation • Examples – Perl programs are partially compiled to detect errors before interpretation – Initial implementations of Java were hybrid; the intermediate form, byte code, provides portability to any machine that has a byte code interpreter and a run-time system (together, these are called Java Virtual Machine)
  • 27. Copyright © 2007 Addison- Wesley. All rights reserved. 1-27 Hybrid Implementation Process
  • 28. Copyright © 2007 Addison- Wesley. All rights reserved. 1-28 Just-in-Time Implementation Systems • Initially translate programs to an intermediate language • Then compile the intermediate language of the subprograms into machine code when they are called • Machine code version is kept for subsequent calls • JIT systems are widely used for Java programs • .NET languages are implemented with a JIT system
  • 29. Copyright © 2007 Addison- Wesley. All rights reserved. 1-29 Preprocessors • Preprocessor macros (instructions) are commonly used to specify that code from another file is to be included • A preprocessor processes a program immediately before the program is compiled to expand embedded preprocessor macros • A well-known example: C preprocessor – expands #include, #define, and similar macros
  • 30. Copyright © 2007 Addison- Wesley. All rights reserved. 1-30 Programming Environments • The collection of tools used in software development • UNIX – An older operating system and tool collection – Nowadays often used through a GUI (e.g., CDE, KDE, or GNOME) that runs on top of UNIX • Borland JBuilder – An integrated development environment for Java • Microsoft Visual Studio.NET – A large, complex visual environment – Used to program in C#, Visual BASIC.NET, Jscript, J#, and C++
  • 31. Copyright © 2007 Addison- Wesley. All rights reserved. 1-31 Summary • The study of programming languages is valuable for a number of reasons: – Increase our capacity to use different constructs – Enable us to choose languages more intelligently – Makes learning new languages easier • Most important criteria for evaluating programming languages include: – Readability, writability, reliability, cost • Major influences on language design have been machine architecture and software development methodologies • The major methods of implementing programming languages are: compilation, pure interpretation, and hybrid implementation