CS 342 Lecture -*- Outline -*- * COURSE REVIEW ** Design *** What is the algebraic view of design? *** Examples? ** Costs and Benefits How does one judge a language? What are main costs and benefits? ** Principles *** How do costs and benefits relate to the "principles"? *** Categories of principles **** expressiveness (abstraction, automation, inf. hiding, allowing expression of security, structure or readability, meta-linguistic abstraction) **** efficiency (programming time, compile-time, run-time, object file size, run-time space, localized costs, portability) **** aesthetics (simplicity, syntactic consistency, orthogonality, regularity, zero-one-infinity, terseness or syntactic abstraction) **** others? *** Which are most important? *** Study aids **** Make a chart as follows: principles on one axis, vs. examples (features) from CLU, Smalltalk, Scheme What is most important principle? why? define it? Any response? Give example? Give violation? Next most important principle? why? define it? Any response? Give example? Give violation? Describe a new principle that accounts for our evaluation of Prolog's successes and failures? Any others? (efficiency? high-level? clean definition? aimed at a specific programming method? constraining number of expression vs extension? meta-linguistic extension?) How do the principles relate to costs/benefits? **** Draw an implicatio graph: which principles imply the others e.g., regularity implies syntactic consistency Pick a principle that is implied by another principle and describe the dependency. **** What are the conflicts/tradeoffs among principles? **** Features vs. principles What principles can apply to what features? e.g.: name binding (scope) type checking abstraction facilities calling conventions For each principle, name a feature or features that allow the principle to be embodied in *programs* ** What features are important? *** Some are virtually language independent **** naming: scopes, mutation of bindings, ... **** abstraction mechanisms: procedural, data, control (both declaration and use: parameterization) **** expressing security constraints: declarations, types *** Some depend on goals of particular system What kinds of goals? **** Application area: scientific processing => algebraic notation symbolic list processing => lists, symbols, recursion O.S. interface => commands, notion of state, ... **** Intended users: novice programmer, expert, biologist, ... **** Support programming method or design strategy: top-down design => nesting of modules data abstraction => information hiding, name type checking table-driven designs => first-class functions, or dynamic binding (messages) meta-linguistic abstraction => programs as data **** Paradigm support: object-oriented => dynamic binding, inheritance functional => first-class functions, full closures logic => logical variables, unification, resolution ** Language Paradigms (frameworks) What are the various language frameworks? imperative, applicative, functional, OOP, Logic What framework do you prefer and why? for simulation? for database work? for numerical/scientific programming? Which language paradigm has the most potential for (eventually): putting programmers out of work? solving problems quickly? leading to code reuse? helping programmers write correct code? rapid prototyping? Which paradigm is the most expressive? Which paradigm is the most efficient in programmer time? at run-time? (on what kind of hardware) Which paradigm is the most aesthetically pleasing? ** Run-time data structures and algorithms (these are data abstractions, naturally) Make a list of the run-time data structures: various built-in types (e.g., arrays, lists, records, variants, pointers) activation records run-time stack variable addressing (display, static chaining) procedure call/return similarly, block entry/exit, non-local gotos closures heap garbage collection, reference counting vs. explicit deallocation What are the relative costs where there are implementation choices? stack vs. display variable accessing, procedure call/return explicit deallocation vs. garbage collection ** Historical innovation (skip this) What principles were first illustrated by Gen. Language(s) 0. Pseudo Code Interpreters 1. Fortran (1957) 1 or 5. LISP (1958-60) 2. Algol (1960) and Algol 58 3. Pascal (1971) 3. C (1972) 4. CLU (1975), Ada (1979-83) 5 or 1. Prolog (1972) 5. Smalltalk (1972-80) and Simula 67 What features/implementation techniques were introduced? What are common characteristics of the generations What problems were introduced? What problems of earlier languages were solved? ** Research directions: *** New paradigms (hard): constraint programming *** New applications: using language design ideas for a specific area (non-general purpose languages) *** Improving expression, efficiency, aesthetics, etc. Parallelism (efficient use of hdw., motivates major paradigms) Type checking (security) Semantics (defining/describing languages) helps evaluate simplicity/regularity of language models motivate languages and features Abstraction mechanisms (data abstraction, inheritance, control)