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, data abstraction, higher-order functions, combinators, and polymorphism. It is during this part that we learn to think functionally, to view programs not (necessarily) as sequences of commands manipulating some global state, but as compositions of (pure) functions which decompose and reorient data.

In the second part of the course we implement an interpreter for a simple (but ultimately quite powerful) programming language. The topics covered include parsing, syntax and semantics, variable scope and binding, storage management, and infinite data types. After this part, you will have your own implementation of a programming language for which you can write and run programs (pretty neat).

Prerequisites

Generally speaking, you will get the most out of this course (and will have the best time of it) if you complete the 200 level courses required for the degree of computer science beforehand. Above all, experience with a high-level programming language (like Python or Java) is essential.

Requisites

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

Minutiae

Instructors: Assaf Kfoury and Nathan Mull

Teaching Fellows: Zachery Casey and Qiancheng (Robin) Fu

Course Assistants: Jason Wang and Sebastian Wu

Lecture Times: Tuesday and Thursdays, 3:30PM-4:45PM

Lecture Location: Stone Science Auditorium (STO) B-50

Lab Times/Locations: See the registrar page

See the Course Information section for more information.

Schedule

Date

Topic

Reading

Assignments

1/18

Course Introduction

OCP 1.(1-3)

HW0 out

1/23

Beginning Ocaml I: Expressions

OCP 2.1, 2.2.(1-2), 2.3

1/24

Week 2 Lab: Set-Up Help

1/25

Beginning OCaml II: Functions

OCP 2.4, 2.6

HW1 out, HW0 due

1/30

Beginning OCaml III: Unions, Products

OCP 3.2, 3.4, 3.9.(1-3)

1/31

Week 3 Lab

2/1

Begnning Ocaml IV: Lists, IO

OCP 2.6, 3.1

HW2 out, HW1 due

2/6

Inductive Types I: Introduction

OCP 3.9

2/7

Week 4 Lab

2/8

Inductive Types II: Examples

OCP 3.9, 3.11

HW3 out, HW2 due

2/13

Class canceled

2/14

Week 5 Lab

2/15

Higher-Order Programming I: Maps, Filters

OCP 4.(1-3)

HW4 out, HW3 due

2/20

Higher-Order Programming II: Folds, Examples

OCP 4.(4-7)

2/21

Substitute Monday (No Lab)

2/22

Intermediate OCaml I: Options, Monads, Modules

OCP 3.7, 8.7, 5.1, 5.2

HW4 due

2/27

Midterm Exam

2/28

Week 7 Lab

2/29

Formal Grammar I: Introduction

HW5 out

3/5

Formal Grammar II: Ambiguity

3/6

Week 8 Lab

3/7

Formal Grammar III: Extended BNF, Regular Expressions

HW6 out, HW5 due

Spring Recess

3/19

Parsing I: Introduction

3/20

Week 9 Lab

3/21

Parsing II: General Parsing

HW7 out, HW6 due

3/26

Parsing III: Combinators

3/27

Week 10 Lab

3/28

Formal Semantics I: Operational Semantics

HW8 out, HW7 due

4/2

Formal Semantics II: Applying Rules

4/3

Week 11 Lab

4/4

Formal Semantics III: Designing Rules

P1 out, HW8 due

4/9

Subprograms I: Variable Binding and Scoping

4/10

Week 12 Lab

4/11

Subprograms II: Parameter Passing

P2 out, P1 due

4/16

Subprograms III: Activations Records and Closures

4/17

Week 13 Lab

4/18

Subprograms IV: The Substitution Model

P3 out, P2 due

4/23

Advanced Topic: Compilation

4/24

Week 14 Lab

4/25

Advanced Topic: The Lean Theorem Prover

P3 due

4/30

Final exam review session

Course Information

Lectures

Lectures are held twice a week, and the two instructors of the course will trade-off teaching one of the two lectures each week.

Labs

Labs will be held weekly by our TFs and TAs. More detail on the nature of these labs to come.

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

The first part of the course depends on the textbook OCaml Programming: Correct + Efficient + Beautiful.

All other course material will be made available on the courses GitHub repository (more information on this shortly). If you are unfamiliar with git and GitHub, see the GitHub documentation for information and tutorials. We will also cover some basics in labs.

Assignments

There will be 8 graded assignments throughout the semester. They are made available on Thursdays and are due the following Thursday by 11:59PM (see the Schedule above). Roughly half are written assignments and half are programming assignments.

Assignments will be submitted via Gradescope. If you are unfamiliar with Gradescope, see their Get Started page for more information. We will drop your lowest two assignment grades 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.

Final Project

Part of your final grade in the course will be determined by your completion of a final project. The project has three parts which makes up the final three-weeks-worth of assignments. More information about the nature of this project will be made available in the second-half of the course.

Policies and Guidelines

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

Log