Chapter 1 - Introduction Flashcards
6 Reasons for studying concepts of PLs
1) increased capacity to express programming concepts
2) improved background for choosing appropriate languages
3) increased ability to learn new languages
4) Understanding the significance of implementation
5) increased ability to design new languages
6) overall advancement of computing
Increased capacity to express programming concepts. Why important?
- awareness to a wider variety of PLs features allows programmers to more easily overcome the data/algorithmic limitations of any one language
- knowing more languages help broaden the scope SW dev thought process
Why is the ability to choose the appropriate language important?
-allows the programmer to pick the best PL for the task at hand
Why is it a important to understand the significance of implementation?
Allows for better understanding of how a PL is more or less efficient and suited for a particular task
6 Programming Domains
Scientific applications Business applications AI Systems Programming Scripting Languages Special Purpose Langs
5 Programming Lang Eval Criteria
1) Readability
2) Writability
3) Reliability
4) Cost
5) Others
Readability factors
Overall simplicity
Breadth of features (too many or repeated features is bad)
Orthogonality
Construct meaning is context independent
Control Stmts
Data type and structures
Syntax
Writability Factors
Simplicity and orthogonality support for abstraction
Expressivity
Reliability Factors
Type checking
Exception handling
aliasing
Readability & Writability
Cost Factors
Programmer training needed Software creation Compilation Execution Compiler cost Poor reliability maintenance
Other Factors
Portability
Generality
Well-definedness
2 influences of Lang design
Computer architecture
Programming methodologies
Influence of Computer architecture on Lang design
The use of von Neumann machines contributes to use of imperative Langs
Influence of programming methodologies on Lang design
50s and 60s ➡️ worried about efficiency
Late 60s ➡️ people efficiency aka readability
Late 70s ➡️ data abstraction
80s ➡️ object oriented programming
Lang categories
Imperative
Functional
Logic
Object oriented
Imperative Lang examples
C Fortran COBOL PL1 Algol
Functional Lang examples
ML
LISP
Logic Lang examples
Prolog
3 Lang design trade offs
Reliability vs cost of execution
Writability vs readability
Flexibility vs safety
3 Implementation Methods
Compilation
Pure interpretation
Hybrid systems
What is compilation implementation?
Translates high level code to machine code
The steps of compilation
Lexical analysis
Syntax analysis
Intermediate code generation
Code generation
Pro and Con of Compilation
Pro ➡️ fast execution
Con ➡️ dedicated to a given hardware
What is pure interpretation?
A program called an interpreter reads each statement of the program and executes it line by line
Pro and Con of pure interpretation
Pro ➡️ error messages are close to source code
Con ➡️ slow execution
What is a hybrid system
Translating high level code to an intermediate Lang that allows for easy interpretation
Pros of hybrid system
Small translation cost
Medium execution speed
What is a preprocessor?
A program that processes a source program immediately before Compilation