CAS CS 320: Concepts of Programming Languages

What is this course?

CAS CS 320 is a course about programming languages, particularly the design and implementation of programming languages. In this course, we take up the "programming language" as an object of formal study. This course is not about how to program, though the principles we cover are generally useful for designing and reasoning about programs.

The first part of the course is on functional programming in OCaml, based on CS 3110: Data Structures and Functional Programming at Cornell University and its associated textbook (referred to as OCP below). Its topics include inductive types, higher-order functions, and polymorphism. It's during this part that we learn to think functionally, to view programs not as sequences of commands manipulating global state, but as compositions of functions which deconstruct and reorient data.

In the second part of the course we implement several interpreters for a small fragment of OCaml itself; that is, we will write OCaml programs which execute OCaml programs. The topics covered include parsing, operational semantics, variable scope and binding, type checking and type inference. After this part, you will be able to execute some of the simpler programs we wrote in the first part of the course using your own interpreter (pretty neat).

Prerequisites

You'll get the most out of this course (and will have the best time of it) if you've completed the 200 level CS major requirements beforehand. Experience with a high-level programming language (like Python or Java) is a must.

Requisites

The workload for this course consists of assignments, mini-projects, a midterm exam, and a final exam. Your final grade in the course will be determined by the following breakdown:

Minutiae

Instructors: Ankush Das and Nathan Mull

Teaching Fellows: Zachery Casey, Qiancheng (Robin) Fu, and june wunder

Lecture Times and Locations:

Lab Times: See the Course Registar

See the Course Information section for more details.

Assignments

Schedule

See the full list of topics (linked in the entries of the table below) for more details.

Date

Topic

Assignments

Tue 9/3

Course Introduction

A0 out

Wed 9/4

Week 1 Lab: Installation Help

Thu 9/5

Beginning Ocaml I: The Basics

A1 out

Tue 9/10

Beginning Ocaml II: Let Expressions

Wed 9/11

Week 2 Lab: Practice with Ocaml

Thu 9/12

Beginning OCaml III: Unions and Products

A2 out, A1 due

Tue 9/17

Beginning OCaml IV: Lists, Tail Recursion

Wed 9/18

Week 3 Lab: Practice with Derivations

Thu 9/19

Algebraic Data Types

A3 out, A2 due

Tue 9/24

Polymorphism

Wed 9/25

Week 4 Lab: Practice with HOP

Thu 9/26

Higher Order Programming I: Maps and Filters

A4 out, A3 due

Tue 10/1

Higher Order Programming II: Folds

Wed 10/2

Week 5 Lab: Practice with Folds

Thu 10/3

Modules and Monads

A5 out, A4 due

Tue 10/8

Midterm Review

Wed 10/9

Week 6 Lab: The Result Monad

Thu 10/10

Progress and Preservation

A5 due, A6 out

Tue 10/15

No Lecture

Wed 10/16

Week 7 Lab: Midterm Review

Thu 10/17

Midterm

Tue 10/22

Parsing I: Formal Grammar

Wed 10/23

Week 8 Lab: Practice with Grammars

Thu 10/24

Parsing II: Lexer/Parser Generators

A7 out, A6 due

Tue 10/29

Formal Semantics I: Operational Semantics

Wed 10/30

Week 9 Lab: A Calculator

Thu 10/31

Formal Semantics II: The Substitution Model

MP1 out, A7 due

Tue 11/5

Formal Semantics III: Variables, Scope, Closures

Wed 11/6

Week 10 Lab: Desugaring

Thu 11/7

Formal Semantics IV: The Environment Model

MP2 out, MP1 due

Tue 11/12

Type Checking I: Introduction

Wed 11/13

Week 11 Lab: The Simply-Typed Lambda Calculus

Thu 11/14

Type Checking II: In Practice

Tue 11/19

Type Inference I: Introduction

Wed 11/20

Week 12 Lab: Practice with Unification

Thu 11/21

Type Inference II: Unification

MP3 out, MP2 due

Tue 11/26

Type Inference III: In Practice

Wed 11/27

No Lab

Thu 11/28

No Lecture

Tue 12/3

Compilation I: Stack-Based Languages

Wed 12/4

Week 14 Lab: Help with Mini-Project 3

Thu 12/5

Compilation II: In Practice

MP3 due

Tue 12/10

Advanced Topic: TBA

TBA

Final Exam

Course Information

Lectures

We hold lectures each week on Tuesdays and Thursdays (see details above). During lecture, we cover the material that is presented in the reading and do some live coding examples. Lecture material is available in the course repository before the lecture meeting.

It is not guaranteed that everything we cover in lecture will be available in the associated reading. So although we will not take attendance, it is highly recommended that you come to lecture if you want to get the most out of the course.

The course is split into two parts, the first part on OCaml and the second part on building interpreters. The first part will be taught by Ankush Das and the second part will be taught by Nathan Mull.

Labs

We hold lab meetings once a week on Wednesdays (see details above). Please attend the lab meeting in which you are registered. This is an opportunity for you to engage with the material in a smaller setting with our teaching fellows. We will not take attendance, but again, its highly recommended that you attend; our teaching fellows can provide you with another invaluable perspective on the material.

Communication

Announcements and discussions will happen on Piazza. If you are unfamiliar with Piazza, see their support page for information and tutorials. Some policies regarding the use of Piazza:

You will also be expected to periodically check this webpage for updates.

Material

Much of the course (particularly the first half) uses the textbook OCaml Programming: Correct + Efficient + Beautiful.

All other course material will be made available on the course GitHub repository and on this webpage. If you are unfamiliar with git and GitHub, see the GitHub documentation for information and tutorials.

Assignments

There will be 7 graded assignments throughout the semester. They are made available on Thursdays and are due the following Thursday by 11:59PM (see the Schedule above). Most assignments are programming-based, but there will be a few written assignments as well.

Assignments are to be submitted via Gradescope. If you are unfamiliar with Gradescope, see their Get Started page for more information. We will drop your lowest assignment grade so only 6 assignments will count towards your final grade in the course. This means we will not accept late homework assignments, under any circumstances.

Mini-Projects

In the second half of the course, we'll primarily be working on mini-projects, each of which requires you to build an interpreter. Each interpreter will be a bit more complex than the last. You should think of these as roughly the same amount of work as two programming assignment, but with a single large programming task (building an interpreter) instead of many small programming tasks. It is not possible to drop a mini-project.

Policies and Guidelines

Please read carefully through this general BU Course Policies page. We take all matters of student mental health and safety, inclusion, and academic misconduct very seriously.