Lecture 1 Flashcards
Why are different programming languages written?
To solve different problems. Different tools for different reasons.
What are some general purpose languages?
C++, C
What are the characteristics of abstraction?
- Encapsulation
2. Information Hiding
What are the types of abstraction?
- Data
2. Procedural
What does an optimizer do?
Places statements pertaining to the same data close to one another in memory.
What are the three language constructs?
Repetition, sequence, condition
What percentage of a company’s budget is spent on maintenance vs. on development?
80 % on maintenance.
What is a unit of work?
Do the entire unit of work or do nothing. Ex: ATM. Attempts transaction and backs everything out if there is an issue.
What is aliasing?
Referring to memory addresses using different types and different symbolic names
What is perfective maintenance?
Enhancements
What is protective maintenance?
Security
What is adaptive maintenance?
Changing technology without changing functionality
What is corrective maintenance?
Fixing bugs
Why is compiling programs a cost?
Separation of duties. You have individual employees dealing with the build process.
What is reliability?
Conformance to specifications
What does overall simplicity mean?
A manageable set of features and constructs, minimal feature multiplicity, minimal operator overloading
What is orthogonality?
A relatively small set of primitive constructs can be combined in a relatively small number of ways. Optimally, every possible combination is legal.
What is abstraction?
The ability to define and use complex structures or operations in ways that allow details to be ignored.
What is expressivity?
The breadth of ideas that can be represented and communicated in the language.
What is portability?
The ease with which programs can be moved from one implementation to another.
What is generality?
The applicability to a wide range of applications.
What computer architecture are programming languages developed around?
The Von Neumann architecture
When did the Von Neumann architecture come into ues?
1940-1950
What are the characteristics of the Von Neumann architecture?
- Data and programs stored in memory
- Memory is separate from CPU
- Instructions and data are piped from memory to CPU
- Imperative languages match Von Neumann architecture best.
Why do imperative languages match Von Neumann architecture best?
- Variables model memory cells
- Assignment statements model piping
- Iteration is efficient
What is the fetch-execute-cycle on Von Neumann architecture computer?
- Initialize program counter
- Repeat forever:
- Fetch instruction pointed to by counter
- Increment counter
- Decode instruction
- Execute instruction
What was the programming paradigm in the 1950s/60s?
Simple applications, worry about machine efficiency.
What was the program paradigm in the late 60s?
People efficiency became important; requiring better readability and control structures.
What was the program paradigm in the late 70s?
Went from process oriented to data oriented
What was the programming paradigm in the mid-1980s?
Object oriented programming: Data abstraction + inheritance + polymorphism
What are the categories of languages?
- Imperative
- Functional
- Logic
- Markup/Programming Hybrid
What are imperative languages?
- Variables
- Assignment statements
- Iteration
- Object Oriented Programming
What are functional languages?
Primary means of making computations is by applying functions to given parameters
What is object oriented programming?
Simplification of data and procedural abstraction and building it into languages.
What is range checking?
A compiler feature that will prevent you from referencing an element that is out of range of the defined size of an array.
What are the language design tradeoffs?
- Reliability vs. cost of execution
- Readability vs. writability
- Writability (flexibility) vs. reliability
What are the methods of implementation of programming languages?
- Compilation
- Pure interpretation
- Hybrid Implementation Systems
What are hybrid implementation systems?
A compromise between compilers and pure interpreters. High level language translated to intermediate language that allows easy interpretation.
What is pure interpretation?
Where every line is translated one at a time. It uses more memory and is slower than compilation.
What is an example of a hybrid implementation system?
Java Bytecode
What are the phases of compilation?
- Lexical Analysis
- Syntax Analysis
- Semantics Analysis
- Code Generation
What is lexical analysis?
A process that converts characters in the source program into lexical units. This is where the symbol table gets created.
What is syntax analysis?
Transforms lexical units into parse trees, which represent syntax.
What is semantics analysis?
Attempts to understand the intention of the programmer, generates intermediate code.
How many passes are most compilers?
2:
- Symbol Table (sometimes Syntax)
- (sometiems Syntax), Intermediate Code, uses symbol table for code generation
During which phase in the compilation process can optimization be applied?
Semantic Analysis
What is a load module?
An executable image, the user and system code together
What is linking and loading?
The process of collecting system program units and linking them to a user program.
What is an unresolved reference?
When the compiler marks in the symbol table when it is unable to find something
What is a linkage editor?
Looks in libraries to find reference and updates symbol table with module if found. Otherwise, error out and fail compilation.
What is the Von Neumann bottleneck?
The connection speed between a computer’s memory and its processor determines the speed of a computer. Since instructions can be executed faster than the speed of the connection, a bottleneck is created.
What is a way to get around the Von Neumann bottleneck?
Use multiple processors
What are the characteristics of Pure Interpretation?
- No translation (no .exe output)
- Easier implementation of programs
- Slower execution
- Usually requires more space
What are the characteristics of hybrid implementation systems?
- Mix of interpreted/compiled
- High level program translated to intermediate language that allows easy interpretation
- Faster than pure interpretation
What are some examples of Hybrid Implementation Systems?
Initial implementations of Java, Perl.
What is the Hybrid Implementation Process?
- Source Program
- Lexical Analyzer
- Syntax Analyzer
- Intermediate code generator
- Interpreter
What is the Pure Interpretation Process?
- Source Program
- Interpreter
- Results
Where does the descriptor reside?
The symbol table
What is a data type?
A collection of data objects and a set of predefined operations on those objects
What is a descriptor?
A collection of the attributes of a variable