Chapter 1 Flashcards
Why should Concepts of programming languages be studied?
Programming is new.
General language concept knowledge helps.
Increased ability to express ideas.
“ “ to learn new languages.
Helps choose appropriate languages.
Understand tradeoffs.
Overall advancement of computing
What are the Language Evaluation Criteria?
Readability, Writability, Reliability, Cost
What is Readability defined as?
The ease with which programs can be read and understood
What is Writability defined as?
The ease with which a language can be used to create programs
What is Reliability defined as?
Whether a language performs to its specifications under all conditions
What is Cost defined as?
cost of using the language
What is the Evaluation Criteria for Readability?
Overall simplicity: Manageable set of features and constructs(minimal feature multiplicity, minimal operator overloading)
Orthogonality: small set of primitive constructs can be combined in small number of ways
Data types; if types are missing, they must be simulated
Syntax considerations: Lack of naming restrictions increase readability (Identifier forms). More special words = more readable (Special words). meaningful keywords, avoid language constructs with same name and different meaning(Form and meaning)
Why is a lack of orthogonality bad?
It can lead to exceptions
Why is too much orthogonality bad?
bad for readability
What is the problem with too much simplicity?
Can be bad for readability
What is the Evaluation Criteria for Writability?
Simplicity and orthogonality: few constructs, small number of primitives, small set of rules for combining them
Support for abstraction: define and use complex structures/operations.(Process abstraction and Data abstraction)
Expressivity: convenient ways of specifying operations. Strength + number of operators and predefined functions
What is process abstraction?
Provision for subprograms
What is data abstraction?
classes, pointer & dynamic memory
What is the Evaluation Criteria for Reliability?
Type checking: Test for type errors. Compile time checking > run time checking
Exception handling: intercept run time errors and correct it
Aliasing: Presence of 2+ distinct referencing names for same memory location. (dangerous feature)
Readability and writability: non-natural ways of expressing algorithms = unnatural approaches = reduced reliability
What is the Evaluation Criteria for Cost?
Training new programmers.
Writing programs
compiling programs
Executing programs
Language implementation system (availability of free compilers)
Reliability(poor = high cost)
Maintaining programs
What are some extra Evaluation Criteria?
Portability : ease of moving from on implementation to another
Generality: applicability to a wide range of applications
Well-definedness: Completeness + precision of of language’s official definition
What are the Language Design trade-offs
Reliability vs cost of execution
Readability vs writability
Writability(flexibility) vs reliability
What are the programming domains?
Scientific Applications
Business Applications
AI
System Programming
Web Software
What influences the Design of a Language?
Computer Architecture
Programming Methodologies (eg OOP led to new programming paradigms)
What influenced Programming Methodologies?
1950/60: simple applications (machine efficiency)
1960s: Efficiency + readability + better control structures (structured programming + top-down design + step-wise refinement)
1970: Process- oriented -> data-oriented (data abstraction
1980: OOP (Abstraction + inheritance + polymorphism)
What are the Language Categories?
Imperative: Variables, assignment statements, iteration. has OOP languages. Includes visual languages. (c++ Java C ..)
Functional : Main means of computation, applying functions to parameters (LIST, Scheme)
Logic: Rule based (Prolog)
Markup/hybrid (XSLT, JSTL)
What are the Implementation Methods
Compilation: programs translated to ML
Pure Interpretation: Programs are interpreted by another program known as an interpreter
Hybrid: compromise between compilers and pure interpreters
What are the phases of Compilation
Lexical analysis: converts source characters to lexical units
Syntax Analysis: Transforms lexical units to parse trees
Semantics analysis: Generate intermediate code
Code generation: Machine code is generated
Is Compiled or Pure Interpreted programs faster
Compiled.
Interpreted programs are 10-100 times slower