I. course summary A. review of syllabus ------------------------------------------ WHAT WE STUDIED Models - Declarative + Exceptions + Security (NewName, !!, Chunks) - Concurrent + By-need evaluation (demand-driven) - Message Passing - [Explicit State] - Relational (logic programming) Programming - Functional - Declarative - Declarative Concurrent - Message passing - Relational (logic programming) ------------------------------------------ What's the difference between the declarative and functional models? What does the declarative concurrent model add? What does the message passing model add? What does the relational model add? Does the relational model still have message passing features? B. language design and model ideas ------------------------------------------ WHAT DID WE LEARN ABOUT COMPUTATION MODELS AND LANGUAGE DESIGN? dataflow variables records (lists) pattern matching message passing lazy (ByNeed) (vs. eager) higher-order functions, closures exception handling programming techniques: recursion (follow the grammar!) iteration (tail recursion) syntactic sugaring (desugaring) currying generalization by abstraction (function parameters) layered use of models ------------------------------------------ What primitives are helpful, powerful? What techniques? What principles? C. Programming lessons What did you learn about programming from each? ------------------------------------------ WHAT DID WE LEARN ABOUT PROGRAMMING? 1. declarative functions without side effects, easier to reason about follow the grammar! using examples and generalize use extra arguments to make functions tail recursive enforcing data abstraction with naming (NewName) 2. declarative concurrent use partial values to represent streams use dataflow variables to control program flow use lazy evaluation for demand-driven flow control can modularize computations by streams bounded buffers can be used to solve flow control problems 3. message passing client server programming design by thinking about the states/transitions asynchronous message passing can simulate other primitives ------------------------------------------ 1. Declarative 2. Declarative concurrency 3. Message Passing 4. Explicit State 5. Relational (logic programming) 6. Comparison What are the advantages and disadvantages (limits) of each paradigm? How do they compare for making programming easier? D. what's the value of all this? ------------------------------------------ WHAT'S THE VALUE OF ALL THIS? Programming is language design: - make it easy for your users - give them good notation - provide primitives, ways to combine them, and abstraction facilities Kernel language approach: - find primitives that give new power - add sugars on top of these ------------------------------------------ E. where to go from here ------------------------------------------ WHERE TO GO FROM HERE Further classes: - COP 5021 Program Analysis - COP 6621 Compilers ------------------------------------------ II. style (or model) vs. problems A. styles vs. kinds of problems that work well ------------------------------------------ WHAT KINDS OF PROBLEMS WORK WELL IN... Declarative (+ higher-order) style? math stuff, semantics tree transformations (XML or other grammar) web page production, transformation polymorphism (generic programming) Declarative Concurrent (+ demand-driven) style? dealing with infinite data structures (approximation formulas) pipeline ready problems (break up into stages) if don't necessarily need all of the answer Message Passing style? distributed computing, client-server robust, dependable systems problems that require multiple independent clients to interact with some shared resource/data Relational (logic programming) style? recording specifications rapid prototyping search in small domains database interaction, especially queries Explicit State (ADT, OO) style? ------------------------------------------ B. What kinds of things are not easily done in a given style? ------------------------------------------ WHAT IS NOT EASILY DONE IN ... Declarative style? time-varying data (state) I/O or interaction with concurrent agents Declarative Concurrent style? all of the above merging of independent streams (race conditions) without waiting in deterministic order Message Passing style? sharing time-varying data in a modular way reasoning about uses of a component Relational style? Explicit State (ADT, OO) style? ------------------------------------------