<<

record Explanations Descriptive The principal programming paradigms See "Concepts, Techniques, and Models of Computer Programming". declarative programming The chart classifies programming paradigms according to their kernel XML, "More is not better (or worse) than less, just different." languages (the small core language in which all the paradigm’s S−expression abstractions can be defined). Kernel languages are ordered according to Data structures only the creative extension principle: a new concept is added when it cannot be Turing equivalent + procedure v1.08 © 2008 by Peter Van Roy encoded with only local transformations. Two languages that implement the same paradigm can nevertheless have very different "flavors" for the First−order + cell (state) Imperative programmer, because they make different choices about what Observable functional programming techniques and styles to facilitate. nondeterminism? Yes No programming programming Pascal, When a language is mentioned under a paradigm, it means that part of + closure Imperative the language is intended (by its designers) to support the paradigm search Functional + search without interference from other paradigms. It does not mean that there programming programming is a perfect fit between the language and the paradigm. It is not enough + unification Scheme, ML + name SNOBOL, Icon, Prolog that libraries have been written in the language to support the paradigm. (equality) (unforgeable constant) The language’s kernel language should support the paradigm. When + continuation there is a family of related languages, usually only one member of the Deterministic ADT ADT + cell logic programming Continuation + cell + port (state) + closure family is mentioned to avoid clutter. The absence of a language does functional imperative (channel) not imply any kind of value judgment. programming programming programming Sequential + search Scheme, ML Event−loop object−oriented Haskell, ML, E CLU, OCaml, Oz programming State is the ability to remember information, or more precisely, to store a Relational & logic + by−need + thread programming sequence of values in time. Its expressive power is strongly influenced by programming synchron. + single assign. + nondeterministic + port E in one vat Stateful the paradigm that contains it. We distinguish four levels of expressiveness, Prolog, SQL Lazy Monotonic choice (channel) + thread functional which differ in whether the state is unnamed or named, deterministic or embeddings functional dataflow Nonmonotonic Multi−agent programming nondeterministic, and sequential or concurrent. The least expressive is Multi−agent functional programming (threaded state, e.g., DCGs and monads: + solver programming programming dataflow dataflow programming Java, OCaml programming programming unnamed, deterministic, and sequential). Adding concurrency gives Constraint (logic) Haskell Declarative Message−passing + thread declarative concurrent programming (e.g., synchrocells: unnamed, programming concurrent Concurrent logic Oz, Alice, AKL concurrent Concurrent deterministic, and concurrent). Adding nondeterministic choice gives CLP, ILOG Solver programming programming programming object−oriented concurrent logic programming (which uses stream mergers: unnamed, + thread Pipes, MapReduce Oz, Alice, Curry, Excel, Erlang, AKL programming nondeterministic, and concurrent). Adding ports or cells, respectively, + thread + by−need AKL, FGHC, FCP gives message passing or shared state (both are named, nondeterministic, Concurrent Shared−state + single assignment synchronization + synch. on partial termination + local cell concurrent and concurrent). Nondeterminism is important for real−world interaction constraint (e.g., client/server). Named state is important for modularity. programming Lazy Functional reactive Active object programming dataflow programming LIFE, AKL programming (FRP) Smalltalk, Oz, Axes orthogonal to this chart are typing, aspects, and domain−specificity. programming Object−capability Java, Alice + by−need synchronization Weak synchronous Typing is not completely orthogonal: it has some effect on expressiveness. Lazy programming programming + log Aspects should be completely orthogonal, since they are part of a Lazy concurrent declarative FrTime, SL CSP, Occam, Software program’s specification. A domain−specific language should be definable constraint concurrent in any paradigm (except when the domain needs a particular concept). programming programming + instantaneous computation E, Oz, Alice, transactional publish/subscribe, memory (STM) Oz, Alice, Curry Oz, Alice, Curry Strong synchronous tuple space (Linda) Metaprogramming is another way to increase the expressiveness of a programming SQL embeddings language. The term covers many different approaches, from higher−order Logic and Esterel, Lustre, Signal Dataflow and programming, syntactic extensibility (e.g., macros), to higher−order constraints Functional message passing Message passing Shared state programming combined with syntactic support (e.g., meta−object protocols and generics), to full−fledged tinkering with the kernel language Nondet. state (introspection and reflection). Syntactic extensibility and kernel language Unnamed state (seq. or conc.) Named state tinkering in particular are orthogonal to this chart. Some languages, such More declarative Less declarative as Scheme, are flexible enough to implement many paradigms in almost native fashion. This flexibility is not shown in the chart.