CS 320 - Concepts of Programming Languages

Spring, 2018

Instructor and Lecture

Times and Locations

Instructor:Wayne Snyder

      Email: waysnyder at gmail dot com

      Office: MCS 290

      Office Hours for CS Advising: T 4-6 (for general CS advising)

     Office Hours for CS 320: M 7:30 - 9pm, W 4-6pm

      Tutoring Hours in Rich Hall: T 7:30-10:30pm

      Cell Phone: 617-966-(210+41) (text in an emergency; in general, email vastly preferred, but if you call, leave a message!);



      A1: M, W 2:30 - 3:45pm (CAS B12)
      B1: M, W 6:00 - 7:15pm (CAS B12)


     A2: W 9:05 - 9:55am (KBC 102)
     A3: W 10:10 - 11:00pm (KBC 102)
     A4: W 11:15 - 12:05pm (KBC 107)
     A5: W 12:20 - 1:10pm (KBC 102)

     B2: W 11:15 - 12:05am (EPC 201)
     B3: W 12:20 - 1:10pm (CAS 204B)
     B4: W 1:25 - 2:15pm (CAS 204B)
     B5: W 2:30 - 3:20pm (CAS 220)

Teaching Fellows:

     Mark Lemay (lemay at bu dot edu)
         Office hours: M 4 - 6pm in Ugrad Lab

     Cheng Zhang (czhang03 at bu dot edu)
         Office hours: Th 2 - 4pm in Ugrad Lab

Useful Links

  • Piazza
  • Syllabus
  • Github: HTML
  • Programming Environments for Haskell:
  • Haskell.org (Haskell download and resources): HTML
  • Hoogle (Haskell search engine): HTML
  • Book: Learn you a Haskell for Great Good: HTML
  • Book: Real World Haskell: HTML
  • Hutton's PPT Slides based on book are on this site: HTML
  • PDF Slides by Ralf Lammel based on slides by Hutton: PDF
  • Haskell Cheat Sheet (nice summary of all of Haskell): PDF
Lecture & Readings/Videos
Assignments and Practice Problems
1 W 1/23

Administrative matters; Overall Plan for the course; Motivation: Why learn functional Programming?

Lecture Slides: PDF

Here is my channel where I will post lecture videos: YT

2 M 1/28

Bare-Bones Haskell: Constructing data expressions, functions on data expressions, expressions as trees, rewrite semantics;

Reading: Hutton Chapters 1 & 2; also you could look at section 8.2 on data declarations (just for the basic idea; ignore anything you don't understand).

Lecture Slides: PDF

Also, make sure you remember recursive tree traversals, particularly preorder and postorder; here is my CS 112 lecture on this: PDF

Here is a video talk-through of the last couple of slides from Lecture 2, which I did not finish in section A1: HTML

Practice Problems on data and function definitions and computation by matching and rewriting: HTML
3 W 1/30

Function definition by pattern matching; polymorphic types.

Reading: Hutton, Ch. 3.1 - 3.7

Lecture Slides: PDF


HW01 Solution: PDF

Video walkthrough of HW 1 analytical part (with hints!):HTML

4 M 2/4

Polymorphic data and functions; type checking; function definitions; modules

Reading: Hutton, Ch. 3.8 - end, 4.1 - 4.4

Lecture Notes: PDF

Practice Problems 2 A Alternate (using build-in syntax for Integers, tuples, and lists) HTML

Practice Problems 2 B Alternate (using build-in syntax for Integers, tuples, and lists) HTML

5 W 2/6

Functions as first-class values; map and filter;lambda expressions; functions manipulating functions; modules.

Reading: Hutton, Finish chapter 4. On modules, read HTML up to right before the section on Data.List.

Lecture Notes: PDF


Solution for HW 2, analytical part: PDF

Typo fix in problem One a4 uploaded 2/10 11am.

Here is a short video with some hints: HTML

6 M 2/11 Basic Haskell: Haskell built-in list and tuple types; Case expressions; Beta-reduction for lambda expressions and let expressions; HO programming continued: Curried functions; (if time) Function composition with currying.

Reading: Hutton Ch. 4 & 7

Lecture Slides: PDF

Practice Problems 3: HTML

Practice Problems 4: HTML

7 W 2/13

Curried functions, HO programming paradigms concluded: foldr; Type classes.

Reading: Hutton 5 & 15.1-15.5

Lecture Slides: PDF

HW 3 out, due 2/19
M 2/18 President's Day: Holiday  
8 T 2/19 Virtual Monday!

Type classes Continued.

Reading: Hutton, reread Ch. 3 and then read 8.1 - 8.5, and also section 12.1 (on Functors)

This section from "Learn you a ...." is also worth reading on the basic type classes: HTML

Also the beginning of this section, about the Functor type class, is very good: HTML

Lecture Slides: PDF


9 W 2/20 Type classes concluded.

Reading: Same as last time. Reread it!

Lecture Slides: PDF

HW 4: PDF, due 2/25

10 M 2/25

Review for Midterm

Reading: Hutton, Ch.8.

11 W 2/27 Midterm 1  
12 M 3/4

Functors and monads: the Maybe Monad

Reading: Hutton, Ch. 12

Monads (and functors and applicatives) in pictures:HTML
13 W 3/6

Monads continued; parsing and context-free grammars; parse trees.

Three useful monads in pictures: HTML

HW 5 out, due 3/19
3/11 - 3/15 Spring Break!
14 M 3/18 Lambda Calculus
15 W 3/20

The State Monad; Implementing a functional language: Abstract Syntax Trees, Environments, and Recursive Evaluation.

HW 6 out, due 3/26
16 M 3/25

Dynamic vs static scope, closures.

17 W 3/27

Eager vs lazy evaluation; simultaneous evaluation; infinite lists.

HW 07 out, due 4/1
18 M 4/1

Conclusions and review for midterm.

19 W 4/3

Midterm 2

20 M 4/8 Introduction to Compilation: General notions, Intermediate Code, Translating assignments and expressions.  
21 W 4/10 Translating conditionals and loops HW 8 out, due 4/16
M 4/15 Tax Day: Holiday!
22 W 4/17 Translating short-circuit Boolean expressions; Final Project out, due F 5/3
23 M 4/22 Implementing Function Definitions; the run-time stack.  
24 W 4/24 Function definitions concluded
25 M 4/29 Dependent Types  
26 W 5/1 Conclusions and course evaluations.