The first half of the course introduces functional programming through the Haskell programming language, while the second half covers imperative and concurrent programming via the Rust programming language. Sprinkled throughout at Core lectures---marked with a (C) on the calendar---where we develop a simplified, mathematical model of the language being considered.
Attending lectures is absolutely critical.
Slides will be made available after lectures, but they be difficult to understand in isolation. Readings will cover some---but not all---of the course material. While there will be no attendance component in the grading, it will be extremely challenging to master the material if you do not come to class.
Most lectures are paired with a reading. These are optional and classes will not exactly follow the readings, but you will get more out of the lectures if you skim the readings beforehand (or afterwards). Readings will be drawn from these three books:
- RWH: Real World Haskell by Bryan O'Sullivan, John Goerzen, Don Stewart. Haskell moves quickly and some parts of this book have become outdated; see this summary.
- TRPL: The Rust Programming Language by The Rust Project Developers.
- PFPL: Practical Foundations for Programming Languages (Second Edition) by Robert Harper.
You may also find this notation guide useful.
You are welcome to buy physical copies if you wish---they're good books!---but the online versions will suffice for this course.
Here are a few more texts, giving an different perspective on the main material:
- LYAH: Learn You a Haskell for Great Good by Miran Lipovaca.
- Programming in Haskell (Second Edition) by Graham Hutton.
- Parallel and Concurrent Programming in Haskell by Simon Marlowe.
- Programming Rust by Jim Blandy and Jason Orendorff. Slightly out of date, but includes more details like memory layout in Rust.
- The Rustonomicon by The Rust Project Developers.
More than you ever wanted to know about The Dark Arts of Advanced and Unsafe Rust Programming (which we will not explore in this course).
- TAPL: Types and Programming Languages by Benjamin C. Pierce.
These shorter readings talk about programming languages in general:
- Why Study Programming Languages? by Robert Harper.
- What, if Anything, is a Programming Paradigm? by Robert Harper.
- What Next? by Graydon Hoare.
- Who Teaches Functional Programming? by Swarat Chaudhuri.
- A Brief, Incomplete, and Mostly Wrong History of Programming Languages by James Iry.
- Execution in the Kingdom of Nouns by Steve Yegge.
- Exception Handling Considered Harmful by Jason Robert Carey Patterson.
By the end of this course, you should be able to...
- Program at an intermediate level in Haskell: use functional programming idioms, user-defined datatypes, typeclasses, and monads; control side-effects and mutation.
- Program at an intermediate level Rust: use imperative programming idioms, analyze ownership and borrowing, and implement safe concurrent applications.
- Mathematically specify programming languages in various complementary ways: syntax and grammar, operational semantics, type systems.
This is a 3-credit course for advanced undergraduates and beginning graduate students. We will meet for two 75-minute class periods each week over the spring semester, and you should expect to work on course learning activities for about 3 hours out of classroom for every class period.
We plan to cover the following topics from the recent 2013 ACM/IEEE Computer Science Curricula Guidelines:
- PL/Functional Programming
- PL/Basic Type Systems
- PL/Program Representation
- PL/Concurrency and Parallelism
- PL/Type Systems
In addition, we will touch on parts of the following topics:
- PL/Language Translation and Execution
- PL/Syntax Analysis
- PL/Advanced Programming Constructs
- PL/Formal Semantics
Homeworks will have two parts: a programming lab where you will gain concrete experience working with the two main languages, and a written component to give you practice working with the mathematical core languages. There will be six homeworks in total, issued roughly every two weeks. Homeworks will generally be posted after lecture, and are due roughly two weeks later before lecture. Keep an eye on the calendar!
There will be two "checkups" for helping you get familiar with your Haskell and Rust installations. These will not count towards your homework grades, but you should complete them and turn them in.
- Due to COVID-19, we are significantly relaxing the late day policy.
For assignments before spring break: You will have 6 late days total. Each late day will let you submit up to 24 hours after the original due time. You may use at most 2 late days per homework, and you cannot use fractions of late days: being late 1 hour is the same as being late 23 hours. We will give extra credit for unused late days at the end of the semester, but it will only be a small amount---use late days if you need them.
For assignments after spring break: We are removing the late day system. If you submit your homework within 1 week (7 days) of the due date, you can receive up to 90% of full credit. If you submit your homework by the drop-dead date May 4, 2020, you can receive up to 75% of full credit.
Midterm and Final exam
The midterm exam will be held out of class, tentatively scheduled for Friday, March 6 at the usual time and place. It will be a written test about Haskell and functional programming. We will give you some reference sheets during the exam, stay tuned for details.
The final exam will cover all of the material in the course.
Your grade will be based on these components:
- Homeworks: 70%
- Midterm Exam: 10%
- Final Exam: 20%
Access and Accommodation
The University of Wisconsin-Madison supports the right of all enrolled students to a full and equal educational opportunity. The Americans with Disabilities Act (ADA), Wisconsin State Statute (36.12), and UW-Madison policy (Faculty Document 1071) require that students with disabilities be reasonably accommodated in instruction and campus life. Reasonable accommodations for students with disabilities is a shared faculty and student responsibility. Students are expected to inform me of their need for instructional accommodations by the end of the third week of the semester, or as soon as possible after a disability has been incurred or recognized. I will work either directly with you or in coordination with the McBurney Center to identify and provide reasonable instructional accommodations. Disability information, including instructional accommodations as part of a student’s educational record, is confidential and protected under FERPA.
Diversity and Inclusion
In our class we strive to create an environment where everyone willing to do their part can learn and thrive. You should always feel free to ask a question: asking and pondering questions is how we learn. Being confused is unfailingly an opportunity to advance our knowledge. Please, commit to helping create a climate where we treat everyone with dignity and respect. Listening to different viewpoints and approaches enriches our experience, and it is up to us to be sure others feel safe to contribute. Creating an environment where we are all comfortable learning is everyone’s job: offer support and seek help from others if you need it, not only in class but also outside class while working with classmates.
If something is not working, please let me know ASAP and I will try to fix it.