 |
 |
|
COMS W4115 Programming Languages and Translators Spring 2021 |
Lectures
Class meets Mondays and Wednesdays 5:40 - 6:55 PM Online.
Staff
Overview
The goal of PLT is to teach you both about the structure of
computer programming languages and the basics of implementing
compilers for such languages.
The course will focus mostly on traditional imperative and
object-oriented languages, but will also cover functional and logic
programming, concurrency issues, and some aspects of scripting
languages. Homework and tests will cover language issues. You will
design and implement a language of your own design in a semester-long
team project.
While few of you will ever implement a full commercial compiler
professionally, the concepts, techniques, and tools you will learn
have broad application.
Prerequisites
COMS W3157 Advanced Programming: You will
be dividing into teams to build a compiler, so you need to have some
idea how to keep this under control. Quick test: you need to know
about Makefiles and source code control systems.
COMS W3261 Computer Science Theory: You will
need an understanding of formal languages and grammar to build the
parser and lexical analyzer. Quick test: you must know about regular
expressions, context-free grammars, and NFAs.
Schedule
Date |
Session |
Lecture |
Notes |
Reading |
Due |
Mon Jan 11 |
1
|
Intro. to Languages
|

|
Ch 1, 2
|
|
Wed Jan 13 |
2
|
Language Processors
|

|
Ch. 2
|
|
Mon Jan 18 |
|
MLK Holiday |
|
|
|
Wed Jan 20 |
3
|
Some Outstanding Projects
|

|
|
|
Mon Jan 25 |
4
|
Programming in OCaml
|

|
|
|
Wed Jan 27 |
5
|
"
|
|
|
|
Mon Feb 1 |
6
|
"
|
|
|
|
Wed Feb 3 |
7
|
Syntax and Parsing
|

|
Ch. 3, 4
|
Proposal |
Mon Feb 8 |
8
|
"
|
|
|
HW1 |
Wed Feb 10 |
9
|
"
|
|
|
|
Mon Feb 15 |
10
|
"
|
|
|
|
Wed Feb 17 |
11
|
"
|
|
|
HW2 |
Mon Feb 22 |
12
|
The MicroC Compiler
|

|
App. A
|
LRM, Parser |
Wed Feb 24 |
13
|
Review for Midterm
|

|
|
|
Thu Feb 25 |
|
Midterm Exam |
|
|
|
Mon Mar 1 |
|
Spring Break |
|
|
|
Mon Mar 8 |
14
|
"
|
|
|
|
Wed Mar 10 |
15
|
"
|
|
|
|
Mon Mar 15 |
16
|
"
|
|
|
|
Wed Mar 17 |
17
|
Runtime Environments
|

|
Ch. 7
|
|
Mon Mar 22 |
18
|
"
|
|
|
|
Wed Mar 24 |
19
|
Types and Static Semantics
|

|
Sec. 6.5
|
Hello World |
Mon Mar 29 |
20
|
Code Generation
|

|
|
|
Wed Mar 31 |
21
|
The Lambda Calculus
|

|
|
|
Mon Apr 5 |
22
|
"
|
|
|
|
Wed Apr 7 |
23
|
Prolog
|

|
|
HW3 |
Mon Apr 12 |
|
|
|
|
|
Wed Apr 14 |
25
|
Review for Final
|

|
|
|
Fri Apr 16 |
|
Final Exam |
|
|
|
Fri Apr 23 |
|
Project Reports Due |
|
|
|
Suggested Text
Alfred V. Aho, Monica Lam, Ravi Sethi, and Jeffrey D. Ullman. Compilers: Principles, Techniques, and Tools.
Addison-Wesley, 2006. Second Edition.
The first edition was long the standard text on
compilers; the second edition of the "dragon
book" has now been updated and continues to be
one of the more readable books on the topic.
Columbia's own Prof. Al Aho is one of the authors.
|
 |
Related Texts
Michael L. Scott. Programming Language Pragmatics
Morgan Kaufmann, 2006. Second Edition.
A broad-minded book about languages in general, but has less on
practical details of compiler construction.
|
 |
Andrew W. Appel. Modern Compiler Implementation in ML.
Cambridge University Press, 1998.
The opposite of Scott: focuses on compiler construction, not language
design issues.
It uses the functional language ML, which is closely related to O'Caml,
but just different enough to be annoying.
|
 |
Lawrence C. Paulson ML for the Working Programmer.
Cambridge University Press, 1996. Second edition.
A book about functional programming. It's written for the ML
language, not O'Caml, but the two are closely related.
|
 |
Steven S. Muchnick Advanced Compiler Design and Implementation.
Morgan Kaufmann, 1997.
A very extensive book on many aspects of compiler design. Starts
about halfway through Appel and goes much farther. Recommended for
serious compiler hackers only.
|
 |
Objective Caml Resources
 |
The Caml Language Homepage. Compiler downloads and
documentation. Start here.
|
 |
The Objective Caml System. Documentation and User's Manual for
the whole system, including documentation for ocamllex,
ocamlyacc, ocamldep, ocamldebug, and all the standard
libraries.
|
 |
Emmanuel Chailloux, Pascal Manoury, and Bruno
Pagano, Developing Applications with Objective Caml. An
online book translated from the French (O'Reilly).
|
 |
Objective CAML Tutorial
|
 |
OCaml source for the four-function calculator.
|
 |
OCaml source and test cases for the MicroC language, which
generates LLVM IR.
|
The Project
The focus of 4115 is the design and implementation of a little
language. You will divide into teams and design the goals, syntax,
and semantics of your language, and implement a compiler for your
language.
Final Report Outline
This is a critical part of the project and will be a
substantial fraction of the grade.
Include the following sections:
- Introduction
- Include your language white paper.
- Language Tutorial
- A short explanation telling a novice how to use your
language.
- Language Manual
- Include your language reference manual.
- Project Plan
- Identify process used for planning, specification, development
and testing
- Include a one-page programming style guide used by the team
- Show your project timeline
- Identify roles and responsibilities of each team member
- Describe the software development environment used (tools and
languages)
- Include your project log
- Architectural Design
- Give block diagram showing the major components of your translator
- Describe the interfaces between the components
- State who implemented each component
- Test Plan
- Show two or three representative source language programs along
with the target language program generated for each
- Show the test suites used to test your translator
- Explain why and how these test cases were chosen
- What kind of automation was used in testing
- State who did what
- Lessons Learned
- Each team member should explain his or her most important
learning
- Include any advice the team has for future teams
- Appendix
- Attach a complete code listing of your
translator with each module signed by its author
- Do not include any automatially generated files, only the
sources.
Project Resources
 |
An excellent final report: the Funk language by 4115 students
Naser AlDuaij, Senyao Du, Noura Farra, Yuan Kang, and
Andrea Lottarini.
|
 |
An excellent final report: the Sheets language by 4115 students
Benjamin Barg, Gabriel Blanco, Amelia Brunner, and Ruchir Khaitan.
|
Language Reference Manuals
Projects
My favorites
Grading
40 % Project |
20 % Midterm |
30 % Final |
10 % Homework |
Collaboration
You will collaborate with your own small team
on the programming project, but you may not collaborate with others on
homeworks. Teams may share ideas about the programming assignments,
but not code. Any two teams found submitting similar code will
receive zero credit for the whole assignment, and repeat offenses will
be referred to the dean. See
the
Columbia CS department academic policies for more details.
Other

