e.g., MOVE $t2, $t1 → ADD $t2, $t1, $zero
Accumulator-based Assembly FORTRAN (c. 1957) Put data1 into Accumulator
Add data2 to Accumulator
Move contents of AccumulatorCSQRD = A**2 * B**2
HUGE!
Imperative — based on von Neumann architecture: state-driven fetch-execute-store virtual machine
Procedural Object-Oriented Algol (c. 1960) → Pascal (1970) / C (1972) → C++ (c. 1983) ⮑ Simula (c. 1969) → Smalltalk (c. 1980)
objects / data abstraction, classes as first-class types, message passing / dynamic binding, inheritance➡ To really understand the difference between imperative and object-oriented, we need to look at Structure Design vs. Object-Oriented Design (OOD).dynamic binding ⟶ can be hard to predict or follow the flow of control
- Set up things that can respond to events
- Write the responses
- Control-flow is driven by events (user events, system events, etc.)
Functional: LISP
- Language based on mathematical functions and λ-calculus
- Key Ideas:
- Functions as 1st-class entities
- No state
- atoms & lists; functions and data have same form (lists)