140 likes | 322 Views
History Lessons. History Lesson . Konrad Zuse 1936-1945 electromechanical relays Plankalkul = program calculus bit integer floating-point using twos-complement notation arrays & records recursion for..fin selection w.o. else mathematical expressions (like Eiffel’s assertions).
E N D
History Lesson • Konrad Zuse • 1936-1945 electromechanical relays • Plankalkul = program calculus • bit integer • floating-point using twos-complement notation • arrays & records • recursion • for..fin • selection w.o. else • mathematical expressions (like Eiffel’s assertions)
Machine Language First • Machine language • Pseudocodes • Short Code - John Mauchly 1949 > UNIVAC 1 • 72 bit words - 12 six-bit bytes - examples on p42 • X0 = SQRT(ABS(Y0)) • interpreted a.k.a. automatic programming • 50 times slower than machine code
Pseudocodes • Speedcoding • John Backus - 1951 - IBM 701 • virtual 3-address floating-point calculator • interpreted • +,-,*,/,SQRT,SINE, ARC TANGENT, EXPONENT, LOGARITHM • conditional & unconditional branches • input/output conversions • automatic incrementation of address registers • small usable memory 4.2 millisecs for +
Compiling Systems • Grace Murray Hopper at UNIVAC • A-0, A-1, A-2 expanded pseudocode > machine language • Wilkes (1952) similar work • Wheeler • relocatable vs. absolute addresses • Wilkes 1951, 1957 - assembly program + • chosen subs & allocate storage
IBM 704 & FORTRAN • Machine influenced development of language • Lack of hardware for floating point ops made interpreters acceptable • 704 • Hardware for indexing • Hardware for floating point ops • Control statements based on 704 hardware • chicken vs. egg (language design vs. machine design)
Other early compiled high-level languages • Manchester Mark I computer - Alick E. Glennie - 1952 • MIT Whirlwind - Laning Zierler 1954 • translated arithmetic expressions • used function calls • included subscripted variable references
Environment for FORTRAN • computers slow, small, relatively unreliable • primary use - scientific computing • no existing efficient ways to program computers • computer costs high - programmer cost low • speed of generated object code
FORTRAN 1 • FORTRAN Programmer’s reference manual - October 1956 (IBM , 1956) • input/output formatting • variable names up to 6 characters • user-defined subroutines (not separately compilable) • IF selection statement • DO loop statement • Arithmetic IF
FORTRAN II • by 1958, half 704 code in FORTRAN • 1958 • Added • independent compilation of subroutines
FORTRANs IV, 77 • FORTRAN IV - 1960-1962 standard til 1978 • FORTRAN IV added • explicit type declarations • logical IF • passing of subprograms as parameters • FORTRAN 77 added • character string handling • logical loop control statements • IF with ELSE
FORTRAN 90 • 1992 • added • collection of array operation functions • DOTPRODUCT, MATMUL, TRANSPOSE, MAXVALUE, MINVALUE, PRODUCT • dynamically allocated & deallocated arrays • records (a.k.a. derived types) • pointers • case • exit • cycle • recursive subprograms having optional & keyword parameters • modules (like Ada packages) - private or public
About FORTRAN • Designer’s goals • Effect of language • Until FORTRAN 90 • types & storage for all variables are fixed before runtime • no new variables or space during runtime • eliminates recursion • data structures that grow or shrink difficult to implement • simplicity over flexibility
Example on Page 49 • What is different from what we have done? • READ *, variableName • PRINT *, ‘ literal string ‘ • IF … THEN …ELSE …END IF