COP 4020 Lecture -*- Outline -*- * course summary ** review of syllabus ------------------------------------------ WHAT WE STUDIED Models - Declarative + Exceptions + Security - Concurrent + By-need evaluation (demand-driven) - Message Passing - [Explicit State] - Relational (logic programming) Programming - Functional - Declarative - Declarative Concurrent - Message passing - Relational (logic programming) ------------------------------------------ Security features are NewName and !! (read-only views) Q: What's the difference between the declarative and functional models? Q: What does the declarative concurrent model add? Q: What does the message passing model add? Q: What does the relational model add? Q: Does the relational model still have message passing features? ** language design and model ideas ------------------------------------------ WHAT DID WE LEARN ABOUT COMPUTATION MODELS AND LANGUAGE DESIGN? ------------------------------------------ Q: What primitives are helpful, powerful? - dataflow variables - closures, higher-order functions - exceptions - NewName and read-only views - message passing (NewPort, Send) - cells - choice, fail, Solve Q: What techniques? grammatical-based explanation and semantics layered use of models (e.g., functional within message passing) kernel-based language with sugars Q: What principles? regularity, uniformity ** Programming lessons Q: What did you learn about programming from each? ------------------------------------------ WHAT DID WE LEARN ABOUT PROGRAMMING? ------------------------------------------ *** Declarative - Following the grammar - Using examples to help plan programming, generalization - Can use dataflow variables to make functions tail recursive - Can use partial values to represent streams - Can enforce data abstraction with naming a sealing operation (NewName) and read-only views *** Declarative concurrency - Dataflow variables allow order of execution to be automatically determined - Can get simple concurrent systems with streams - Stream-based systems are easier with by-need evaluation - Stream-based computations can be useful for modularity - Can use by need evaluation to fix impedance (rate) mismatches - Bounded buffers can be used to solve rate mismatches *** Message Passing - Asynchronous message passing can simulate other primitives - Can use unbound variables as one-shot communication channels or signals - Client server programming - Design by thinking about: state and how each message affects state *** Explicit State - Get modularity with encapsulation of persistent data *** Relational (logic programming) - Relational programming separates search for solutions from specification of solution properties - Generate and test *** Comparison Q: What are the advantages and disadvantages (limits) of each paradigm? (see also the styles-vs-problems.txt file) Q: How do they compare for making programming easier? research question: Can we combine the advantages somehow? ** 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 ------------------------------------------ ** where to go from here ------------------------------------------ WHERE TO GO FROM HERE Further classes: - COP 5021 Program Analysis - COP 6621 Compilers ------------------------------------------