17-363/17-663: Programming Language Pragmatics

Class Tu/Th 12:30 - 1:50 p.m. in DH 2105
Recitation F 1:00 - 1:50 p.m. in GHC 4211
Fall 2023
12 units

Ben Titzer
btitzer at andrew dot cmu dot edu
TCS 447
Office hours: Wednesday 3-5pm (or by appointment)
For appointments outside of office hours, email the instructor.

Jonathan Aldrich
aldrich at cs dot cmu dot edu
TCS 422
Office hours: Thursday 5-6pm (or by appointment)
For appointments outside of office hours, email the instructor.

Course Description

This course provides a broad and pragmatic foundation in the most basic tool of the programmer: programming languages. It starts with the fundamentals of syntax, parsing, and binding, the core structural concepts in programming languages. The course will then cover program semantics and type systems, and students will learn to relate them with a type soundness theorem. Finally, a coverage of intermediate optimization and code generation offers the opportunity to discuss both producing efficient code and reasoning about the correctness of program transformations. Assignments involve a combination of tool-assisted formal reasoning and proofs about programming languages, and implementing these language constructs in a compiler.

Prerequisites. Programming maturity and knowledge of reasoning about programs equivalent to passing 15-150, and mathematical maturity equivalent to passing either 15-251 or 21-228). Students with substantial math and programming experience who have not satisfied the specific prerequisites can contact the instructor for permission to enroll.

Requirements Satisfied.This course fulfills the Logic and Languages constrained elective category for the Computer Science major.

Why take this course?

How does this course compare to CMU's other PL/compilers courses?

First of all, CMU has an amazing selection of courses in this area-you can't go wrong! But this course has some differences that make it a particularly great match for some students:

Course Syllabus and Policies

The syllabus covers course learning objectives, supplemental textbooks, assessments, late work policy, and policies.

Schedule

Date Topic and Slides Additional Reading or Code Assignments Due
Aug 29 Course introduction PLP, chapter 1
Aug 31 Syntax and Lexical Analysis PLP, chapter 2 through 2.2; in-class exercise HW0: Warmup
Sep 1 RecitationImplementing lexical analysis
Sep 5 Parsing preview | Binding PLP, chapter 3; in-class exercise
Sep 7 Inductive definitions and proofs 04-formal.pdf; in-class exercise HW1: Lexical analysis
Sep 8 RecitationThe SASyLF Proof Assistant 04-formal-sasylf.pdf
Sep 12 Dynamic semantics: Big-step lecture05-big-step.pdf; in-class exercise
Sep 14 Dynamic semantics: Small-step small-step.pdf; in-class exercise HW2: Inductive proofs
Sep 15 RecitationDynamic semantics practice
Sep 19 Top-Down Parsing PLP section 2.3; in-class exercise
Sep 21 Bottom-Up Parsing in-class exercise and reference sheet HW3: Dynamic Semantics
Sep 22 RecitationParsing implementation
Sep 26 Typing rules 09-typing.pdf; in-class exercise
Sep 28 Type Soundness 10-soundness.pdf; in-class exercise HW4 checkpoint
Sep 29 RecitationStatic Semantics practice
Oct 3 Type Checking PLP chapter 7
Oct 5 Composite Types PLP Chapter 8 HW4: Parsing
Oct 6 RecitationStatic semantics practice
Oct 10 Mid-semester exam 1
Oct 12 Semantics of Objects PLP chapter 10; Featherweight Java paper
Oct 13 RecitationMidterm discussion HW5: Static semantics
Oct 24 Implementation of Objects Lecture Recording; PLP chapter 10; in-class exercise
Oct 26 Implementing Functional Programming Lecture Recording; PLP chapter 10 HW6 checkpoint
Oct 27 TBA
Oct 31 Intermediate representations and WebAssembly PLP chapter 15; HW6: Typechecking
Nov 2 Garbage collection Notes on garbage collection
Nov 3 Recitation Code generation practice
Nov 7 Democracy Day - No class
Nov 9 Local Optimization and Correctness PLP chapter 17; Notes on Optimization Correctness; in-class exercise HW7 checkpoint
Nov 10 Recitation Optimization and correctness practice
Nov 14 Global Optimization and SSA HW7: Code generation
Nov 16 Dataflow Analysis and Register Allocation
Nov 17 RecitationProject discussion
Nov 21 Loop optimizations HW8: Translation correctness, Project Proposal
Nov 23 No class - Thanksgiving break
Nov 24 No Recitation - Thanksgiving break
Nov 28 Control Flow PLP chapters 6 and 9; in-class exercise
Nov 30 Rust
Dec 1 Recitation2nd midterm review
Dec 5 Midterm exam 2
Dec 7 PL research: Gradual Verification
Dec 8 No Recitation
Dec 15, 1-4pm, GHC 4215 Project presentations Project presentations and final deliverables