JP

programing class ch2

Genealogy of Common Languages

  • Timeline (1957–2014) illustrates evolutionary links among languages
    • Early roots: \text{Fortran I (1957)} \rightarrow \text{Fortran II (1958)} \rightarrow \text{Fortran IV (1962)}
    • Parallel branches: FLOW-MATIC, ALGOL 58, LISP, APL, COBOL, SIMULA I, BASIC, PL/I, SNOBOL
    • ALGOL-derived family: ALGOL 60 ⟶ ALGOL W, ALGOL 68 ⟶ Pascal, BCPL, C, Modula-2/3, Oberon, C++, Ada, Java, C#, etc.
    • Functional lineage: LISP ⟶ Scheme, ML, Miranda, Haskell, F#
    • Logic lineage: Prolog (1972)
    • Scripting branch: awk, Perl, Python, PHP, Ruby, JavaScript, Lua
    • Standards milestones: ANSI C (1989), Fortran 90/95/2003/2008, Ada 95/2005, C99, C# 2.0–5.0, Java 5–8, Python 2–3, Ruby 1.8–1.9

Zuse’s Plankalkül (1945)

  • First high-level language design; unpublished until 1972 and never implemented
  • Advanced for its day
    • Data types: floating-point, arrays, records
    • Formal assertion mechanism: invariants
  • Example assignment syntax
    • |\;A + 1 \Rightarrow A
    • Subscripts line: V\;|\;4\;5 (assign A[4] + 1 to A[5])
    • Types line: S\;|\;1.n\;1.n

Minimal-Hardware Programming: Pseudocodes (late 1940s–1950s)

Why machine code was inadequate

  • Poor readability & modifiability
  • Tedious expression coding
  • Hardware limits: no indexing, no floating point

Short Code (1949, J. Mauchly)

  • Target: BINAC
  • Expression encoded left→right with 2-digit opcodes
    • Examples: 01 (absolute value), 07 (+), 2n (((n+2)^{\text{nd}}) root), 4n (conditional branch if \le n), 58 (print & tab)

Speedcoding (1954, J. Backus)

  • Target: IBM 701
  • Added pseudo-ops for math functions, branches, auto-increment registers
  • Trade-off: interpreted ⇒ slow; only 700 words RAM for user code

Related Systems

  • UNIVAC Compiling System (Grace Hopper) — macro-expands pseudocode to machine code
  • Wheeler’s relocatable address blocks — solved absolute addressing on EDSAC (Cambridge)

IBM 704 & Fortran Line (1954–)

Development Context

  • IBM 704 supplied index registers + hardware FP ⇒ compilation necessary
  • Scientific apps; small, unreliable machines; efficiency paramount; no dev tools

Fortran I (1957)

  • Features
    • Identifiers ≤ 6 chars
    • Post-test DO loops
    • Formatted I/O, user subprograms, arithmetic IF (3-way branch)
    • No type declarations; no separate compilation
  • Cost: 18 worker-years; large (>400 loc) programs seldom compiled on 704
  • Success: very fast object code; quickly dominant

Evolution Summary

  • Fortran II (1958): independent compilation; bug fixes
  • Fortran IV (1960-62): explicit typing, logical IF, parameterizable subprogram names; ANSI 1966
  • Fortran 77 (1978): character strings, logical loop control, \text{IF – THEN – ELSE}
  • Fortran 90 (1990): modules, dynamic arrays, pointers, recursion, \text{CASE}, type-checked params
  • Later: 95 (minor), 2003 (OOP, C interop), 2008 (local blocks, co-arrays, \text{DO CONCURRENT})

Evaluation

  • High-quality optimizing compilers (static storage, fixed types)
  • Permanently changed scientific computing and compiler technology

Functional Programming: LISP Family

Original LISP (1959-60, J. McCarthy)

  • Aimed at AI: list processing + symbolic computation
  • Two data types: atoms, lists; syntax based on lambda calculus
  • Control: recursion + conditionals; no variables/assignments
  • Remains dominant in AI; major dialects: Common Lisp, Scheme

Scheme (mid-1970s, MIT)

  • Minimal core; static scoping; first-class procedures; excellent for education

Common Lisp (1980s)

  • Union of major LISPs; large & industrial-grade

Influence

  • Inspired ML, Haskell, F# (functional yet typed)

The First Step Toward Sophistication: ALGOL Series

ALGOL 58

  • Goals: math-like, algorithmic description, machine-translatable
  • Innovations: formal "type", unlimited identifier length, multidimensional arrays, in/out parameter modes, \text{begin…end} blocks, := assignment, \text{if…else if}, semicolon separator; deliberately omitted I/O

ALGOL 60

  • Added: nested blocks & lexical scope, call-by-value & call-by-name, recursion, stack-dynamic arrays
  • First language with formal BNF syntax; first machine-independent imperative language
  • Failures: no standard I/O → limited uptake; flexible spec hard to implement; overshadowed by Fortran & lack of IBM support

COBOL (1959–)

  • Business-oriented, DoD-sponsored; derived from FLOW-MATIC
  • FLOW-MATIC traits: English-like verbs, 12-char names with hyphens, data/code separation
  • COBOL design goals: English readability, ease of use > power, enlarge user base
  • Contributions
    • First macro facility
    • Hierarchical records
    • Nested selections, long hyphenated identifiers (≤ 30 chars)
    • Separate DATA DIVISION
  • DoD mandate ensured survival; still top business language

Timesharing & BASIC (1964)

  • Dartmouth (Kemeny & Kurtz); for non-science students
  • Desired: friendliness, fast homework turnaround, free/private access; user time prioritized
  • Visual Basic is major modern dialect; BASIC pioneered interactive timeshared use

PL/I (1964–)

  • IBM & SHARE; unify scientific (Fortran) and business (COBOL) worlds
  • 3×3 Committee; originally NPL → PL/I (1965)
  • Innovations
    • Unit-level concurrency (begin…task)
    • Exception handling
    • Switch-selectable recursion
    • Pointer type, array cross-sections
  • Criticism: over-large, feature interactions poorly designed

Early Dynamic Languages: APL & SNOBOL

APL (~1960, K. Iverson)

  • Hardware description → terse array calculus with rich operator set
  • Dynamic typing/storage; cryptic but expressive; still niche

SNOBOL (1964, Bell Labs)

  • Focus: string pattern matching; dynamic types; slower than editors
  • Still used for specialized text processing

Data Abstraction Origins: SIMULA 67

  • Norway, Nygaard & Dahl; extension of ALGOL 60
  • Added coroutines + foundational OO concepts: classes, objects, inheritance

Orthogonal Design: ALGOL 68

  • Emphasized orthogonality (few primitives × few combiners)
  • New concepts: user-defined types, reference types, flex (dynamic) arrays
  • Marginal adoption but influenced Pascal, C, Ada

Pascal (1971, N. Wirth)

  • Small, teaching-oriented, structured programming discipline
  • Dominant academic language (≈1975–1995)

C (1972, D. Ritchie)

  • System programming for UNIX; derived from BCPL/B & ALGOL-68
  • Powerful operators, weak typing; migrated beyond OS work

Logic Programming: Prolog (1972)

  • Procedural interpretation of first-order logic; intelligent DB with inference engine
  • Inefficient but excels at symbolic AI and rule-based problems

Ada Line (1975–)

Ada 83

  • Massive DoD-funded project (Strawman → Steelman specs)
  • Features
    • Packages (info hiding), generic units, robust exception handling
    • Built-in concurrency via tasks
  • Early compiler difficulties; exhaustive SE principles

Ada 95 & 2005

  • Added OOP (type derivation), enhanced concurrency, interfaces
  • Popularity waned after DoD dropped mandate + rise of C++

Object-Oriented Revolution

Smalltalk (1970s, Xerox PARC)

  • First pure OO language (objects everywhere, inheritance, dynamic binding)
  • Introduced GUI paradigm; evangelized OOP concept

C++ (1980, B. Stroustrup)

  • Mixes OO with C; multiple paradigms → large & complex
  • ANSI/ISO 1997; MC++ adds properties, delegates, single inheritance only

Objective-C (early 1980s, B. Cox)

  • C with Smalltalk-style messaging; core of Apple macOS/iOS stacks

Java (1995, Sun)

  • Simplified C++; removed unsafe features (struct, union, pointers, many coercions)
  • Only OO; has references, built-in concurrency, JVM portability, applet support
  • Fastest adoption curve; versions 5–8 add generics, enums, lambdas, streams

C# (2000, Microsoft) – .NET flagship

  • Influenced by C++, Java, Delphi
  • Adds: delegates, properties, limited unsafe pointers, anonymous/dynamic types
  • Rapid evolution (C# 2–5 ⇒ generics, LINQ, async/await)

Scripting Languages

Perl (1987, L. Wall)

  • Static types, implicit declarations; 3 namespaces ($, @, %); strong in CGI & sys-admin; “There’s More Than One Way To Do It” philosophy

JavaScript (1995, Netscape + Sun)

  • Client-side, HTML-embedded; interpreted; syntax resembles Java; basis of dynamic web pages

PHP (1995, R. Lerdorf) – Hypertext Preprocessor

  • Server-side HTML-embedded; dynamic websites & CMS

Python (1991, G. van Rossum)

  • OO scripting; dynamically typed yet type-checked; lists, tuples, dicts; clear syntax; web & scientific use

Ruby (1995, Y. Matsumoto)

  • Pure OO; operators = methods; user-definable; interpreted; web (Rails)

Lua (1993, PUC-Rio)

  • Lightweight embeddable; single table data structure covers arrays, dicts, objects; extensible; game scripting & CGI

Markup/Programming Hybrids

  • XSLT: transforms XML via template-matching; includes programming constructs (loops, conditionals)
  • JSP (Java Server Pages): embeds Java in HTML; JSTL tag library supplies loops, conditionals as HTML elements

Summary

  • Historical progression shows responses to hardware limits, application domains, and software engineering ideals
  • Key innovations: compiled code (Fortran), functional paradigm (LISP), block structure & formal syntax (ALGOL 60), data abstraction & OO (SIMULA 67, Smalltalk), exception handling & concurrency (PL/I, Ada), portability via VM (Java), rapid scripting for the web (Perl, JavaScript, PHP, Python, Ruby), multi-paradigm evolution (.NET/C#)
  • Trends: increasing abstraction, safety, concurrency, portability, and domain specialization; design influenced by both technological constraints and organizational politics (e.g., DoD, IBM)