Comp Sci 321: Programming Languages

LectureTech M345; Tuesdays and Thursdays 11:00—12:20

TextProgramming Languages: Application and Interpretation (First Edition)
by Shriram Krishnamurthi


SoftwareHandin Status

quick-ref.rkt a quick reference to things Racket; open in DrRacket

tips_and_tricks.pdf some DrRacket tips and tricks (courtesy of Hakan Dingenc)

Vincent St-Amour
Office Hours: Mondays 3pm-4pm, or by appointment, Mudd 3215

Spencer Florence, Chloe Brown, Hakan Dingenc, Shu Han, Jenny Lam, Daniel McGrory, and Jack Wiig
Office Hours:
Mondays: 4pm-6pm (in Wilkinson)
Tuesdays: 4pm-6pm (in Wilkinson), 6pm-8pm (in Tech EG20)
Wednesdays: 2pm-4pm, 6pm-8pm (in Tech EG20)
Thursdays: 2pm-4pm, 6pm-8pm (in Tech EG20), 8pm-10pm (in Wilkinson)
Fridays: noon-2pm (in Tech EG20)

Week #DateTopicReadings
1Tuesday, September 24th, 2019Introduction
01a-intro.pdf 01b-plai.pdf
PLAI §1, §2
1Thursday, September 26th, 2019Variables and Binding
02-variables-binding.pdf lec02.rkt
1Due: 6pm on Friday, September 27th, 2019HW 1: Setup and Finger Exercises
2Tuesday, October 1st, 2019Functions and Parsing
03-functions-parsing.pdf starter-lec03.rkt lec03.rkt
2Thursday, October 3rd, 2019Deferred Substitution
04-deferred-substitution.pdf starter-lec04-wae.rkt starter-lec04-f1wae.rkt lec04-timing.rkt lec04-plots.rkt lec04-wae.rkt lec04-f1wae.rkt lec04-f1wae-hash.rkt
2Due: 6pm on Friday, October 4th, 2019HW 2: Binding
3Tuesday, October 8th, 2019Random Testing
05-random-testing.pdf starter-lec05.rkt lec05-subst.rkt lec05-deferred.rkt lec05.rkt
3Thursday, October 10th, 2019Higher-Order Functions
06-higher-order-functions.pdf starter-lec06.rkt lec06.rkt
3Due: 6pm on Friday, October 11th, 2019HW 3: Multi-Argument Functions
4Tuesday, October 15th, 2019Capture-Avoiding Substitution, Compilation
07a-capture-avoiding-substitution.pdf 07b-compilation.pdf starter-lec07.rkt lec07.rkt
4Thursday, October 17th, 2019Higher-order Functions II, Recursion
08a-higher-order-functions-2.pdf 08b-recursion.pdf starter-lec08.rkt starter-lec08-y.rkt lec08.rkt lec08-y.rkt
PLAI §6, §9
4Due: 6pm on Friday, October 18th, 2019HW 4: Deferred Substitution
5Tuesday, October 22nd, 2019Recursion II, State
09a-recursion-2.pdf 09b-state.pdf starter-lec09.rkt starter-lec09-state.rkt lec09.rkt lec09-state.rkt
PLAI §10, §12, §13
5Thursday, October 24th, 2019State II
10-state-2.pdf starter-lec10.rkt lec10.rkt
PLAI §13
5Due: 6pm on Friday, October 25th, 2019HW 5: Higher-Order Functions
6Tuesday, October 29th, 2019Control
11-12-control.pdf starter-lec11.rkt starter-lec11-stack.rkt lec11.rkt lec11-stack.rkt
PLAI §18, §19
6Thursday, October 31st, 2019Control
11-12-control.pdf (cont'd) starter-lec12-stack.rkt starter-lec12-function.rkt lec12-stack.rkt lec12-function.rkt
PLAI §18, §19
6Due: 6pm on Friday, November 1st, 2019HW 6: State
7Tuesday, November 5th, 2019Garbage Collection: Intro
13-gc-intro.pdf starter-lec13.rkt lec13.rkt
PLAI §21
7Thursday, November 7th, 2019Garbage Collection: Mark-and-Sweep
14-15-gc-mark-and-sweep.pdf starter-lec14.rkt lec14.rkt
7Due: 6pm on Friday, November 8th, 2019HW 7: Control
8Tuesday, November 12th, 2019Garbage Collection: Mark-and-Sweep II
14-15-gc-mark-and-sweep.pdf (cont'd) lec15.rkt
8Thursday, November 14th, 2019Garbage Collection: Copying, Types: Intro
16a-gc-copying.pdf 16b-types-intro.pdf
PLAI §24
8No Homework on Friday, November 15th, 2019 
9Tuesday, November 19th, 2019Types: Typing Rules
PLAI §25
9Thursday, November 21st, 2019Types: Typechecking
18-typechecker.pdf starter-lec18.rkt lec18.rkt
9Due: 6pm on Friday, November 22nd, 2019HW 8: Garbage Collection
10Tuesday, November 26th, 2019Types: Type Soundness, Extensions
19a-type-soundness.pdf 19b-types-extensions.pdf starter-lec19-trcfae.rkt starter-lec19-tbfae.rkt starter-lec19-tpfae.rkt lec19-trcfae.rkt lec19-tbfae.rkt lec19-tpfae.rkt
PLAI §28
10Thursday, November 28th, 2019Thanksgiving (no class)
11Tuesday, December 3rd, 2019Types: Type Inference
20-type-inference.pdf lec20-starter.rkt lec20.rkt
PLAI §30
11Thursday, December 5th, 2019Generational GC & Cheney on the MTA
21a-generational-gc.pdf 21b-recap.pdf
11Due: 6pm on Friday, December 6th, 2019HW 9: Types


Your homework each week will be graded automatically and you will receive either a check+ (A), check (B), check- (C), or 0 (F).

When computing your final grade, a check+ is treated like a 9, a check is treated like an 7, a check- is treated like 6, and a 0 is treated like a 0. The numbers are then averaged and this function is used to map them into number grades:

(define (numeric-grade->letter-grade number)
   ((<= 8.3 number 9) 'A)
   ((<= 7.8 number 8.3) 'A-)
   ((<= 7.4 number 7.8) 'B+)
   ((<= 7.0 number 7.4) 'B)
   ((<= 6.4 number 7.0) 'B-)
   ((<= 6.0 number 6.4) 'C)
   ((<= 5.0 number 6.0) 'C-)
   ((<= 4.0 number 5.0) 'D)
   ((<= number 4.0) 'F)))

Homeworks are due on Fridays at 6pm. You can expect grades to be out on the following Monday. Failing that, you will have heard from the course staff regarding when to expect them.

To encourage you to revisit material you have not yet mastered, you have the option to resubmit homework assignments after their original deadline. If your understanding of that homework has improved, hopefully so should your grade. To take advantage of resubmissions, you must have submitted before the original deadline.

Each homework has two resubmission deadlines: hwN-second-round at 6pm the Friday following the original deadline, and hwN-third-round at 6pm the Friday two weeks after the original deadline. Resubmission grading follows the same schedule described above. Late submissions will not be accepted.

Resubmission grades are capped to an 8, halfway between a check and a check+. I.e., if you get a check+ on a resubmission, it counts as an 8.

The last time resubmissions will be accepted will be Friday December 13th, 6pm. There will be no third tries for homework 9.


Collaboration is a really good thing and we encourage it. On the other hand, cheating is a very serious offense, which carries serious consequences. It's OK to meet with colleagues, form study groups, discuss assignments with them, or compare alternative approaches. But it is never ok to share code or homework solutions, or even to see each other's code or solutions. What you turn in must be your own work. Copying (or even studying) code, solutions, etc., from anywhere (e.g., other people, web, GitHub) is strictly prohibited. Be aware that we use the (highly effective) MOSS software similarity detection system. If you discuss your work with another group, please list their names in your hand-in.

It is also forbidden to share, post, or otherwise publicise your solutions. This even extends after the quarter ends. No matter how proud you are of them, no posting your solutions to GitHub; doing so is an invitation to plagiarism.

It is the responsibility of every student in this class to be familiar with and to adhere to the Academic Integrity Policies of Northwestern University and the McCormick School of Engineering. The policies can be found here.

Any suspicion of violation of these policies will be reported immediately to the Associate Dean for Undergraduate Studies. If you are in doubt whether your actions constitute a violation of the above policies, ask the instructor.