COS 326 Func,onal Programming: An elegant weapon for the modern age David Walker Princeton University

Similar documents
COS 326 Functional programming: an elegant weapon for the modern age

COS 326 Func,onal Programming: An elegant weapon for the modern age David Walker Princeton University

Functional Programming

ITT8060 Advanced Programming

h0ps://

Anders Møller Michael Schwartzbach Erik Ernst Hans Hüttel

Recursion. Lecture 6: More Lambda Calculus Programming. Fixed Points. Recursion

COSE212: Programming Languages. Lecture 0 Course Overview

Welcome to. Instructor Marc Pomplun CS 470/670. Introduction to Artificial Intelligence 1/26/2016. Spring Selectivity in Complex Scenes

Introduction, Functions

Functional Programming

CS457/557 Functional Languages

A Pragmatic Case For. Static Typing

As Natural as 0, 1, 2. Philip Wadler University of Edinburgh

Introduction. chapter Functions

CMSC 330: Organization of Programming Languages. Functional Programming with OCaml

Introduction to Computer Science I

Introduction to ML. Mooly Sagiv. Cornell CS 3110 Data Structures and Functional Programming

CS383 PROGRAMMING LANGUAGES. Kenny Q. Zhu Dept. of Computer Science Shanghai Jiao Tong University

CSCE 314 TAMU Fall CSCE 314: Programming Languages Dr. Flemming Andersen. Haskell Basics

Introduction to ML. Mooly Sagiv. Cornell CS 3110 Data Structures and Functional Programming

Conclusions and further reading

CSCI 2041: Introduction

CSCE 314 Programming Languages

Introduction to ML. Mooly Sagiv. Cornell CS 3110 Data Structures and Functional Programming

Programming Language Pragmatics

Functional Programming. Big Picture. Design of Programming Languages

Functional Programming Principles in Scala. Martin Odersky

Languages and Compilers

Lecture 5: The Halting Problem. Michael Beeson

CSE341: Programming Languages Interlude: Course Motivation. Zach Tatlock Winter 2018

Lecture 1. Programming II. Iztok Savnik, FAMNIT. October, 2015.

Chapter 11 :: Functional Languages

Functional Programming Lecture 1: Introduction

Functional Programming

Introduction to Prof. Clarkson Fall Today s music: Prelude from Final Fantasy VII by Nobuo Uematsu (remastered by Sean Schafianski)

Programming Languages and Compilers (CS 421)

Introduction to Prof. Clarkson Fall Today s music: Prelude from Final Fantasy VII by Nobuo Uematsu (remastered by Sean Schafianski)

cmpt 440/821 Advanced Topics in Programming Languages

Functional Programming Lecture 13: FP in the Real World

CS 11 Haskell track: lecture 1

Lecture 5: The Untyped λ-calculus

What is programming? Elements of Programming Languages. From machine code to programming languages. What is a programming language?

CIS24 Project #3. Student Name: Chun Chung Cheung Course Section: SA Date: 4/28/2003 Professor: Kopec. Subject: Functional Programming Language (ML)

02157 Functional Programming Lecture 1: Introduction and Getting Started

CSC 443: Web Programming

Welcome to Introduction to Computer Science I

A Func'onal Space Model

CS 565: Programming Languages. Spring 2008 Tu, Th: 16:30-17:45 Room LWSN 1106

Introduction to Prof. Clarkson Fall Today s music: Prelude from Final Fantasy VII by Nobuo Uematsu (remastered by Sean Schafianski)

Functional Languages. Hwansoo Han

Introduction to Prof. Clarkson Fall Today s music: Prelude from Final Fantasy VII by Nobuo Uematsu (remastered by Sean Schafianski)

Programming Languages and Techniques (CIS120)

COMP 1130 Lambda Calculus. based on slides by Jeff Foster, U Maryland

Simple Lisp. Alonzo Church. John McCarthy. Turing. David Hilbert, Jules Richard, G. G. Berry, Georg Cantor, Bertrand Russell, Kurt Gödel, Alan

The Essence of Compiling with Continuations

SJTU SUMMER 2014 SOFTWARE FOUNDATIONS. Dr. Michael Clarkson

A Programming Language. A different language g is a different vision of life. CSE 130 : Spring Two variables. L1: x++; y--; (y=0)?

understanding recursive data types, recursive functions to compute over them, and structural induction to prove things about them

FUNKCIONÁLNÍ A LOGICKÉ PROGRAMOVÁNÍ 1. ÚVOD DO PŘEDMĚTU, LAMBDA CALCULUS

Simply-Typed Lambda Calculus

301AA - Advanced Programming [AP-2017]

Lecture 1: Introduction. 23. August, 2010

One of a number of approaches to a mathematical challenge at the time (1930): Constructibility

CSci 4211: Data Communications and Computer Networks. Time: Monday and Wednesday 1 pm to 2:15 pm Location: Vincent Hall 16 Spring 2016, 3 Credits

IA010: Principles of Programming Languages

Lambda Calculus.

Machine-checked proofs of program correctness

4/19/2018. Chapter 11 :: Functional Languages

Lecture 1. Introduction to course, Welcome to Engineering, What is Programming and Why is this the first thing being covered in Engineering?

CSC 111 Introduction to Computer Science (Section C)

SOME HISTORY OF FUNCTIONAL PROGRAMMING LANGUAGES. David Turner University of Kent & Middlesex University

Programming Languages. So why study PL? A Programming Language. A different language is a different vision of life. CSE 130 : Fall 2015

Programming Languages. So why study PL? A Programming Language. A different language is a different vision of life. CSE 130 : Spring 2015

J. Barkley Rosser, 81, a professor emeritus of mathematics and computer science at the University of Wisconsin who had served in government, died

CSCI.4430/6969 Programming Languages Lecture Notes

Programming Language Concepts

More Lambda Calculus and Intro to Type Systems

Introduction to Data Structures

Stop coding Pascal. Saturday, April 6, 13

Introduction to Nate Foster Spring 2018

Concepts of program design Exam January 31, 13:30 16:30

CS 378 (Spring 2003) Linux Kernel Programming. Yongguang Zhang. Copyright 2003, Yongguang Zhang

Type Inference. COS 326 David Walker Princeton University

CS3110 Spring 2016 Lecture 5 Modules for Rational Numbers

Compiler Design Spring 2018

Lecture 8: Summary of Haskell course + Type Level Programming

It's Time to Get Good at Functional Programming

Functional Languages. CSE 307 Principles of Programming Languages Stony Brook University

From the λ-calculus to Functional Programming Drew McDermott Posted

Untyped Lambda Calculus

Do Extraterrestrials Use Functional Programming?

Programming Systems in Artificial Intelligence Functional Programming

A Theory of Parallel Computation The π-calculus

Scope and Introduction to Functional Languages. Review and Finish Scoping. Announcements. Assignment 3 due Thu at 11:55pm. Website has SML resources

CIS 500: SOFTWARE FOUNDATIONS

61A LECTURE 1 FUNCTIONS, VALUES. Steven Tang and Eric Tzeng June 24, 2013

Concepts of Programming Languages

Programming Paradigms and Languages Introduction. dr Robert Kowalczyk WMiI UŁ

What Is Computer Science? The Scientific Study of Computation. Expressing or Describing

Transcription:

2007 xkcd COS 326 Func,onal Programming: An elegant weapon for the modern age David Walker Princeton University slides copyright 2013-2015 David Walker and Andrew W. Appel permission granted to reuse these slides for non-commercial educafonal purposes

2 In 1936, Alonzo Church invented the lambda calculus. He called it a logic, but it was a language of pure funcfons -- the world's first programming language. He said: Alonzo Church, 1903-1995 Princeton Professor, 1929-1967 "There may, indeed, be other applica3ons of the system than its use as a logic."

3 In 1936, Alonzo Church invented the lambda calculus. He called it a logic, but it was a language of pure funcfons -- the century? world's first programming language. Greatest technological understatement of the 20 th He said: Alonzo Church, 1903-1995 Princeton Professor, 1929-1967 "There may, indeed, be other applica3ons of the system than its use as a logic."

4 Alonzo Church 1934 -- developed lambda calculus Alan Turing (PhD Princeton 1938) 1936 -- developed Turing machines Programming Languages Computers Op3onal reading: The Birth of Computer Science at Princeton in the 1930s by Andrew W. Appel, 2012. hzp://press.princeton.edu/chapters/s9780.pdf

A few designers of funcfonal programming languages 5 Alonzo Church: λ-calculus, 1934 John McCarthy (PhD Princeton 1951) LISP, 1958 Guy Steele & Gerry Sussman: Scheme, 1975 Standard ML 1986 Implementa,ons: Robin Milner ML, 1978 Luca Cardelli Edinburgh ML, 1981 CaML 1980s Appel & MacQueen: SML/NJ, 1988 Xavier Leroy: Ocaml, 1990 s

They were younger than they appear 6 Alonzo Church: λ-calculus, 1934 Photo ~1960 John McCarthy (PhD Princeton 1951) LISP, 1958 Photo ~1975 Guy Steele & Gerry Sussman: Scheme, 1975 Photo ~1995 Photo ~1995 Implementa,ons: Robin Milner ML, 1978 Photo ~2005 Luca Cardelli Edinburgh ML, 1981 Photo ~1995 Appel & MacQueen: SML/NJ, 1988 Photo 2005 Photo ~2000 Xavier Leroy: Ocaml, 1990 s Photo ~2005

Vastly Abbreviated FP Geneology 7 Miranda (80s) Haskell (90s - now) LCF Theorem Prover (70s) Edinburgh ML Caml (80s-now) Standard ML (90s - now) OCaml (90s - now) Scala (00s - now) F# (now) LISP (50s-now) Scheme (70s-now) Racket (00s-now) untyped Coq (80s - now) lazy call-by-value typed, polymorphic dependently typed

But Why FuncFonal Programming Now? 8 FuncFonal programming will introduce you to new ways to think about and structure your programs: new reasoning principles new abstracfons new design pazerns new algorithms elegant code Technology trends point to increasing parallelism: mulfcore, gpu, data center funcfonal programming techniques such as map-reduce provide a plausible way forward for many applicafons

FuncFonal Languages: Who s using them? 9 map-reduce in their data centers Scala for correctness, maintainability, flexibility F# in Visual Studio Haskell to synthesize hardware mathemafcians Erlang for concurrency, Haskell for managing PHP Coq (re)proof of 4-color theorem www.arfma.com/scalazine/arfcles/twizer_on_scala.html gregosuri.com/how-facebook-uses-erlang-for-real-fme-chat www.janestcapital.com/technology/ocaml.php msdn.microsos.com/en-us/fsharp/cc742182 labs.google.com/papers/mapreduce.html www.haskell.org/haskellwiki/haskell_in_industry Haskell for specifying equity derivafves

FuncFonal Languages: Join the crowd 10 Elements of funcfonal programming are showing up all over F# in Microsos Visual Studio Scala combines ML (a funcfonal language) with Objects runs on the JVM C# includes delegates delegates == funcfons Python includes lambdas lambdas == more funcfons Javascript find tutorials online about using funcfonal programming techniques to write more elegant code C++ libraries for map-reduce enabled funcfonal parallelism at Google Java has generics and GC...

COURSE LOGISTICS 11

12 Course Staff David Walker Professor office: COS 211 email: dpw@ Robin Qiu Grad Student office: Fishbowl email: yqiu@cs Christopher Morey Teaching Faculty Head Preceptor office: COS 208 email: cmorey@ Anders Miltner Grad Student office: Fishbowl email: amiltner@cs

Resources Web: hzp://www.cs.princeton.edu/~cos326 13 Lecture schedule and readings: $(coursehome)/lectures.php Assignments: $(coursehome)/assignments.php Precepts useful if you want to do well on exams and homeworks Install OCaml: $(coursehome)/resources.php

CollaboraFon Policy The COS 326 collaborafon policy can be found here: 14 hzp://www.cs.princeton.edu/courses/archive/fall13/cos326/info.php#collab Read it in full prior to beginning the first assignment. Please ask quesfons whenever anything is unclear, at any Fme during the course.

Course Textbook 15 hzp://realworldocaml.org/

Final Exam 16 There will be a midterm exam, in midterm week Wednesday, October 26 There will be a final exam, in exam period (January Make your travel plans accordingly)

Assignment 0 17 Figure out how to download and install OCaml 4.03 on your machine by the Fme precept begins tomorrow. (or, how to use OCaml by ssh to Princeton University servers) Resources Page: hzp://www.cs.princeton.edu/courses/archive/fall15/cos326/resources.php Hint: ocaml.org

Public Service Announcement 18 The Pen is Mighter than the Keyboard: Advantages of Longhand Over Laptop Note Taking Pam Mueller (Princeton University) Daniel Oppenheimer (UCLA) Journal of Psychological Science, June 2014, vol 25, no 6 hzp://pss.sagepub.com/content/25/6/1159.fullkeytype=ref&siteid=sppss&ijkey=cjrawmrlurgnw You learn conceptual topics bezer by taking notes by hand. Facebook and World of Warcras distract your classmates.