CSE 341: Programming Languages
Course information and policies
This course is an introduction to functional programming (FP). We will cover statically typed FP in OCaml and dynamically typed FP in Racket. We will also relate FP to object oriented (OO) languages, and show how to simulate FP in OO and OO in FP. Along the way we will discuss the theory and design of programming languages.
This is a difficult time. The course will be taught entirely online via Zoom. We will record lectures and section for archival purposes, but real-time attendance is mandatory except in extenuating circumstances. Please get in touch to discuss any accommodations you may need to succeed in this course.
James Wilcox (he/him, they/them)
Jiuru Li (he/him)
Katie Lum (she/her)
Frank Qin (he/him)
Yihong Zhang (he/him, they/them)
Kevin Zhu (he/him)
Approximately 6 homework assignments, combined worth 60% of final grade
Two "individual assignments", together worth 30% of final grade
Attendance and participation in lecture, section, office hours, and online discussion, worth the remaining 10%
No traditional exams, tests, or quizzes
You are encouraged to discuss the homework assignments with your classmates and to collaborate. However, the work you submit should be your own. Do not look directly at anyone else's work or solution. Do not show your work or solution to anyone else. If you work closely with another student, please include a note to that effect in your submission.
Real-time attendance at lecture and section is mandatory except in extenuating circumstances (eg, in a different timezone). If you must miss any of these, please notify all staff by email as soon as possible.
All assignments are due on some day at 5:59:59pm Pacific time. You have 5 late days to use throughout the quarter. Late days are indivisible, and each late day extends the deadline by 24 hours. In other words, if you submit at 6:00:00pm Pacific time on the due date (i.e., 1 second after the deadline), you are charged 1 whole late day and have until 5:59:59pm the next day to keep submitting without spending additional late days. Late days may not be used on "individual assignments".
Staff email list: email@example.com
Gradescope (add code: 9DWB6R)
Setting up development environment:
Instructions to install the CSE VM (available to all students)
Once in the VM install OCaml by running sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) && opam init && eval $(opam env) in the terminal. Type 'y' when it asks to modify ~/.bash_profile.
SSH into attu (remote CSE Linux cluster, available to CSE students only): from terminal, ssh <CSENetID>@attu.cs.washington.edu , password is your CSE login password. attu has OCaml installed on it.
To use OCaml in the terminal (VM or attu): type ocaml to start the REPL, ocaml <OCaml file name> to execute an OCaml file, or ocamlc -o <output file name> <OCaml file name> to compile an OCaml file into an executable with the given output file name.
UW CSE505: Programming Languages (graduate-level course)
UW CSE490P: Advanced Programming Languages and Verification (advanced undergrad-level course, includes videos)
Software Foundations (graduate-level online textbook on programming languages, using the Coq proof assistant)
Types and Programming Languages by Benjamin Pierce (standard graduate-level textbook in programming languages)
hw0 (due Monday 10/5 at 5:59:59pm Pacific time)
hw1 (due Wednesday 10/14 at 5:59:59pm Pacific time)
If you're using attu, you will get errors about the Option module because of an old version of OCaml installed on the server. Follow these instructions (also available in video walkthrough) to install an up-to-date version of OCaml in your attu home directory.
Alternatively, you can download option.ml, put it under the same directory with your hw1.ml, and then run
or, to compile, use ocamlc -o hw1 option.ml hw1.ml,
or type #mod_use "option.ml";; before your #use "hw1.ml" if you are using the REPL.
hw2 (due Friday, 10/23 at 5:59:59pm Pacific time)
hw3 (due Monday, 11/2 at 5:59:59pm Pacific time)
All videos (CSE netid or course enrollment required)
L01 (9/30): Welcome to 341! Intro to variable bindings in OCaml.
S1 (10/1): Editors, OCaml scoping
L02 (10/2): Syntax and semantics of variable bindings and expressions; intro to function bindings
L03 (10/5): Function bindings
L04 (10/7): Tuples and Lists
S2 (10/8): Type synonyms, datatypes, pattern matching, type generality
L05 (10/9): Local bindings, exponential efficiency, options, mutation and aliasing
L06 (10/12): Records, variants, and match expressions
L07 (10/14): More variants and match
S3 (10/15): More pattern matching, tail recursion
L08 (10/16): The truth about functions; Nested patterns
L09 (10/19): Tail recursion and exceptions
L10 (10/21): First-class and higher-order functions
S4 (10/22): Higher-order functions
L11 (10/23): Lexical Scope; Closures; Intro to Currying
L12 (10/26): Closure idioms; More Currying
L13 (10/28): Mutation; Modules
S5 (10/29): Currying, Modules