CS 342 Lecture -*- Outline -*- * Analysis ** Paradigms of programming *draw Venn diagram *** Procedural **** Imperative or von Neumann (mutation, assignment) Algol 60, Pascal, Ada ***** Objects with indefinite lifetimes (heap-based) CLU, LISP Object-oriented (dynamic binding + inheritance) ST-80, Simula, CLOS **** Applicative (no mutation, no assignment) Pure LISP, data-flow languages ***** Functional (first-class functions) FP, Pure LISP Lazy (lazy evaluation) Miranda *** Declarative (nonprocedural) **** Database systems (relations + queries) SQL **** Logic-oriented (horn-clauses) Prolog **** Constraint-based Bertrand, Thing-Lab **** Equational-logic based OBJ *** Other dimensions: parallelism, type systems, ... ** Logic programming features: logical variables, horn clauses, unification, resolution, backtracking terms as only data structure great promise (specifications as programs, logic only, ...) highest level programming? ** Prolog features: first-order, cut (!), SL resolution control interacts with logic no encapsulation, no static checking, no data types (2+2 = 4 fails!) a lot besides logic programming, not clear why: assert, retract allow self-modifying code main problem: it's slow! order of magnitude slower than other langauges e.g. vs. database systems many skeptical it will ever be competative implementation techniques might help (parallelism)