Professor Robert "Corky" Cartwright
Department of Computer Science
Spring 2021: Zoom Virtual classroom provided by the Canvas link
Monday, Wednesday, Friday, 11:00am–11:55am
For more information on the course staff including office hours, see course information.
If you would like to find a partner for completing the projects this semester, we encourage you to use the Search for Teammates! feature on Piazza. The following are some issues to keep in mind when searching for a partner.
COMP 411/511 is an introduction to the principles of programming languages. It focuses on:
A secondary theme of this course is software engineering. All of the programming assignments in this course are conducted in Java using test-driven development and pair-programming, two of the major tenets of Extreme Programming. A compelling reason for using Java is that it is widely used for software development in industry and it supports low-level programming where appropriate. Java Virtual Machines are expensive to start (the Achilles heel of Java IMO) and Java applications are commpiled "Just In Time" (JIT) which has visible costs early in program execution. On the other hand, well-written Java code that has been "warmed up" (run on sufficient inputs to force the JIT compilation of all of the compute intensive parts of the application) is surprisingly fast.
COMP 411/511 consists of three parts:
In the course, you will implements the semantics of a comprehensive collection of programming language constructs using mostly functional interpreters derived from simple reduction (textual rewriting) semantics for the constructs. The constructs include arithmetical and conditional expressions, lexical binding of variables, blocks, first-class functions, assignment and mutuation, basic control constructs (loop exits, first-class continuations, simple threads), and dynamic dispatch.
This course material enables students to analyze the semantics and pragmatics of the old, new, and future programming languages that they are likely to encounter in the workplace (e.g., C, C++, Java, JavaScript, Swift, C#, Python). It also enables students to design and implement efficient interpreters for new languages or DSLs embeded in software applications. Most importantly, it equips students to become master software developers because they will be able to define and implement whatever linguistic extensions are appropriate for simplifying the construction of a particular software system.
My notes on object-oriented program design briefly describe the design patterns that I recommend using to express functional programming abstractions in Java. If you have little prior experience in writing functional programming code in Java, I highly recommend skimming them.
For students interested in operational (syntax-based) semantics, I recommend reading notes by Walid Taha (now at Halmstad University in Sweden) on big-step versus small-step semantics. I strongly prefer small-step semantics, so it is the only form of operational semantics that we will use in this class, but big-step semantics is often used in the programming languages literature.
COMP 511 includes all of the material from COMP 411 plus a modest amount of supplemental material. Portions of projects 3 and 6 are mandatory for Comp 511 students but optional for 411 students, COMP 511 students are also required to complete 3 short written assignments over the course of the semester, discussing concepts from the lectures.
Please take a look at the course information/policies page, which is referenced in the first few class lectures.
# | Date | Day | Topic | Reference | Assignment |
---|---|---|---|---|---|
1 | 1/25 | M | Information & Motivation | ||
2 | 1/27 | W | Parsing |
Web site describing Syntax Diagrams
Note: EBNF notation is explained in Project 1. Component Pascal Syntax Diagrams Tutorial on Context Free Grammars The Java Language Specification |
|
3 | 1/29 | F | Project 1, assigned 1/29 and due at 10am 2/8 | ||
4 | 2/1 | M | The Scope of Variables |
PLAI, ch. 3-4
Why Python is Broken [Python: The Full Monty] |
|
5 | 2/3 | W | Syntactic Interpreters | ||
6 | 2/5 | F | Essentials, ch. 3.7, 3.9 | ||
7 | 2/8 | M | A Meta Interpreter for LC Eliminating Meta-errors |
Brief Review of Lectures 1-6
PLAI, Ch. 4-6 |
Project 1 due at 10am, 2/8
Project 2 assigned 2/8 and due at 10am 2/24 See: Notes on Object-Oriented Program Design |
8 | 2/10 | W | |||
9 | 2/12 | F | |||
10 | 2/15 | M |
Data Domains Supporting Recursive Definitions
|
Domain Theory: An Introduction Chs. 1-4
The Why of Y Recursive Programs as Definitions in First-Order Logic Types as Intervals The Lambda Calculus as a Model of Computation The Pure Lambda Calculus as a Programming Language | 2/17 is a "sprinkle" day; no assignments can be due on that date. I will give an online lecture reviewing the material from Lecture. |
11 | 2/17 | W | |||
12 | 2/19 | F | |||
13 | 2/22 | M | Recursive Binding |
Syntactic Evaluation of Core Jam
Hand Evaluation Exercises Solution to Hand Evaluation Exercises |
Project 3 assigned 2/22
Assignment 3 solution posted at 10am on 2/27 |
14 | 2/24 | W | Eliminating Binding (lambda) |
Project 2 due 10am, 2/24
|
|
15 | 2/26 | F | Assignment and Mutability | ||
16 | 3/1 | M | Monday, March 1, is another "sprinkle day". This week I will present three online lectures covering two slide decks (Lectures 15 and 16) at the usual time, MWF 11am. The material is not difficult. Your main concern is working on project 3. | ||
16 cont. | 3/3 | W | |||
17 | 3/5 | F | Run-time Environment Representation and Control |
Essentials, ch. 7, 8
Powerpoint slides taken from Sebesta's book Concepts of Programming Languages Note: Sebesta presents Fortran 77 as supporting value-result parameter passing in addition to refernce parameter passing. The Fortran 77 standard does NOT include value-result parameeter passing. Sebesta calls value-result parameters "copying parameters" and also refers to them as "result parameters" and parameters of "out mode". Sebesta's account of procedure linkage is accurate assuming Fortran 77 is extended by value-result parameter passing. His description of the Algol 60 run-time is very good. Essentially all modern compiled languages (e.g., Java, C++) use a variant of this run-time. |
|
17 cont. | 3/8 | M |
Project 4 and XC Project 4xc, assigned 3/8
511 Written Assignment 1, assigned 3/8 Project 3 due 10am, 3/8 |
||
18 | 3/10 | W | |||
18 cont. | 3/12 | F | |||
Midterm
Review |
3/15 | M |
Sample Midterm Exam
Solutions to Problems 1, 2, 4, 6 Solution to Problem 3 Solution to Problem 5(i) Solution to Problem 5(ii) |
There is a brief description of how let, let*, and letrec are evaluated in Scheme/Racket in the HTDP book which matches the meanings that we use in Jam. See https://docs.racket-lang.org/reference/let.html. | |
19 | 3/17 | W | Object-Oriented Languages | Essentials, ch. 5 |
Midterm Examination, 6-10pm, March 18
Administered as four 1-hour Canvas quizzes |
19 cont. | 3/19 | F | |||
20 | 3/22 | M |
What Is a Type?
Types and Safety Types and Datatype |
Essentials, ch. 4
Essentials, ch. 6 Type Inference Study Guide |
Project 4 due 11:59pm, 3/22
Project 5 and and XC Project 5xc, assigned 3/22 |
21 | 3/24 | W | |||
22 | 3/26 | F |
Polymorphism
Implicit Polymorphism |
||
23, | 3/29 | M | Unification |
Survey of Unification
Draft Racket program that performs unification inefficiently |
XC Project 4xc, due 11:59pm, 3/29
511 Written Assignment 1, due 11:59pm, 3/29 511 Written Assignment 2, assigned 3/29 |
24 | 3/31 | W |
Typing Imperative Languages
Final Words on Types |
||
25 | 4/2 | F |
Continuation Passing Style (CPS)
Meaning of Function Calls |
Essentials, ch. 7-8 | |
25 | 4/5 | M | Continuation-Passing Style | Project 5 due 11:59pm 4/5 | |
26 | 4/7 | W |
Explaining letcc and error
|
||
27 | 4/9 | F | Storage Management | Dynamic Storage Allocation Survey | XC Project 5xc due Sunday, 11:59pm 4/11. |
28 | 4/12 | M | Garbage Collection | Uniprocessor Garbage Collection Techniques | |
29 | 4/14 | W | |||
4/16 | F |
511 Written Assignment 2, due 11:59pm, 4/16
511 Written Assignment 3, assigned 4/16 Project 6 due 11am, 4/16 Project 7 assigned 4/16 |
|||
30 | 4/19 | M | Retrospective on Software Engineering in Java | ||
4/21 | W | ||||
4/23 | F | Review |
Sample Final Exam
Sample Final Exam With Solutions | ||
Review | 4/26 | M | |||
31 | 4/28 | W | Lambda-lifting and other optimizations for efficient low-level implementations | ||
Review | 4/30 | F | Final Review | a
Project 7 due 11:59pm 4/30
511 Written Assignment 3, due 11:59pm, 4/30 |
Students with disabilities are encouraged to contact me during the first two weeks of class regarding any special needs. Students with disabilities should also contact Disabled Student Services in the Ley Student Center and the Rice Disability Support Services.