When was the invention of the Diffrence Engine
1822
How many stages have the computer languages of the last fifty years come to
Two: The first major language and the second major languages
What is a programming language
A programming language is an artificial
language designed to express computations or
algorithms that can be performed by a
computer
What is a program
A program is computer coding of
an algorithm that
– Takes input
– Performs some calculations on
the input
– Generates output
factorial program in C
int fact(int n) {
int sofar = 1;
while (n>0) sofar *= n–;
return sofar;
}
Master the von Neumann Architecture
Key Features of von Neumann Architecture
Describe the fetch-execute cycle
initialize the program counter (PC)
repeat forever
fetch the instruction pointed by PC
increment the counter
decode the instruction
execute the instruction
end repeat
Mention some programmnig languages that mimic von neumann architecture
C, C++ Java
How do these programming languages micmic the von neumman architecture
– Variables → memory cells
– Assignment statements → data piping between
memory and CPU
– Operations and expressions → CPU executions
– Explicit control of execution flows → prog. counter
The architecture is limited by?
Allow efficient mapping between language and
hardware for good execution performance, but
limited by von Neumann bottleneck
How old is LISP
LISP is the second oldest general programming language
that is still in use since 1958
Give a summary of imperative langauge
– Variables, assignment statements, and iteration
– Include languages that support object-oriented
programming, scripting languages, visual languages
– Ex.: C, Java, Perl, JavaScript, Visual BASIC .NE
Give a summary of functional language
– Computing by applying functions to given parameters
– Ex.: LISP, Scheme, ML
Give a sumary of logic language
– Rule-based (rules are specified in no particular order)
– Ex.: Prolog
Mention the Programming Design Methodology
What makes a good PL
Mention features related to readablity
Overall Simplicity
Orthogonality
Control Statements
Data types and structures
Syntax consideration
Mention features related to writability
Simplicity and orthogonality
Support for abstraction
Expressivity
Mention features related to reliablity
Type checking
Exception handling
Aliasing
Readability and writability
Mention features related to cost
Training programmers to use language
Compiling programs
Executing programs: runtime type checking
Language implementation system
reliability: poor reliability leads to high cost
Maintaining programs
Mention other things that make a good PL
Describe compilation
Translate a high-level program into equivalent
machine code automatically by another program
(compiler)
Mention the phase of compilation
Lexical analysis: converts characters in the source
program into lexical units
– Syntax analysis: transforms lexical units into parse
trees which represent syntactic structure of program
– Semantics analysis: generate intermediate code
– Code generation: machine code is generated
– Link and load