Stephen A. Edwards Columbia University Crown
COMS W4115
Programming Languages and Translators
Fall 2013


Class meets Mondays and Wednesdays 4:10 - 5:25 PM 833 Mudd.


Name Email Office hours Location
Prof. Stephen A. Edwards see my home page 462 CSB
Qiuzi `Jessie' Shangguan Th 4-6 Small meeting area, Fifth floor, CS Building
Mengqi Zhang W 2-4 Small meeting area, Fifth floor, CS Building
John Sizemore M 5:30-7:30 Mudd TA Room
Julian Rosenblum T 3:30-5:30 Mudd TA Room


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 group project.

While few of you will ever implement a full commercial compiler professionally, the concepts, techniques, and tools you will learn have broad application.


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 Computability and Models of Computation: 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.


Date Lecture Notes Reading Due
Sep 4 Intro. to Languages
Ch 1, 2
Sep 9 The C Language Reference Manual

Sep 11 Programming in O'Caml

Sep 16
Sep 18
Sep 23
Sep 25 Language Processors
Ch. 2
Sep 30 Syntax and Parsing
Ch. 3, 4
Oct 2
Oct 7
Oct 9 Getting it right
Ocamlyacc and ASTs

pdf HW1
Oct 14 The MicroC Compiler
App. A
Oct 16
Oct 21 Names, Scope and Bindings
Ch. 6
Oct 23 pdf HW2
Oct 28 Midterm Review

Oct 30 Midterm Exam
Nov 4 Election Day Holiday
Nov 6 Types
Ch. 6
Nov 11 Control-flow
Ch. 6
Nov 13 Code Generation
Ch. 6, 7, 8
Nov 18 Guest lecture: OpenMP

Nov 20 No lecture

Nov 25 The Lambda Calculus

Nov 27 pdf HW3
Dec 2 Logic Programming

Dec 4 Final Review

Dec 9 Final Exam
Dec 20 Project Reports Due

Required 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.

Cover of the Dragon Book 2nd edition

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.

Cover of Programming Language Pragmatics 2nd edition

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.

Cover of Appel

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.

Cover of Paulson

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.

Cover of Muchnick

Objective Caml Resources

webpage The Caml Language Homepage. Compiler downloads and documentation. Start here.
webpage 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.
PDF file Jason Hickey, Introduction to Objective Caml. One of my favorite books on O'Caml.
webpage Emmanuel Chailloux, Pascal Manoury, and Bruno Pagano, Developing Applications with Objective Caml. An online book translated from the French (O'Reilly).
webpage Objective CAML Tutorial
.tar.gz file O'Caml source for the four-function calculator.
.tar.gz file O'Caml source and test cases for the microc language.

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.

Exception: CVN students will do the project individually.

Final Report Outline

This is a critical part of the project and will be a substantial fraction of the grade.

Include the following sections:

  1. Introduction
  2. Language Tutorial
  3. Language Manual
  4. Project Plan
  5. Architectural Design
  6. Test Plan
  7. Lessons Learned
  8. Appendix

Project Resources

pdf A two-page introduction to the CVS version control system. I strongly suggest you keep your project under some version control system.
pdf A sample final report by Chris Conway, Cheng-Hong Li, and Megan Pengelly. It includes the white paper, tutorial, language reference manual, project plan, architectural design, and testing plan. It does not include the lessons learned and code listings sections, although it should.

White Papers

pdf The Java white paper from Sun Microsystems
webpage C# Introduction and Overview

Language Reference Manuals

pdf Dennis M. Ritchie, C Reference Manual
pdf Kernighan & Ritchie, The C Programming Language
pdf The C Language Reference Manual (DEC)
pdf The C Language Reference Manual (SGI)
pdf The C Language Reference Manual (Microsoft)
pdf Stroustrup, The C++ Programming Language
pdf The Java Language Specification
pdf The C# Language Specification
home Aho, Kernighan, and Weinberger, The AWK Programming Language


pubCrawl: Distributed Systems Programming Language (SE) starstar
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Matthew Dean, Sireesh Gururaja, Kevin Mangan, and Alden Quimby
Cpi: Simplified C compiler for ARM V6 (SE) starstar
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Edward Garcia, Niket Kandya, Naveen Revanna, and Sean Yeh
SMURF: Serial MUsic Repeated as Functions (JR) starstar
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Van Bui, Lianne Lairmore, Lindsay Neubauer, Richard Townsend, and Kuangya Zhai
slang: Discrete-event Simulation Language (QS) star
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Olivia Byer, Mauricio Castaneda, Joshua Itwaru, Dina Lamdany, and Tony Ling
vector: High-Level GPU Language (SE) star
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Harry Lee, Howard Mao, Zachary Newman, Sidharth Shanker, and Jonathan Yu
Lorax: Tree-Focused Language (QS) star
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Douglas Bienstock, Chris D'Angelo, Zhaarn Maheswaran, Timothy Paine, and Kira Whitehouse
SMPL: Parallel Programming Language (MZ) star
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
AjaySiva Challa, Andrei Papancea, and Devashi Tandon
PLATO: Programming Language for Abstract Transformation Operators (QS) star
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Yasser Aboudkhil, Daniel Perlmutter, and Joaquin Ruales
CAL: Concise Animation Language (MZ) star
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Jingyi Guo, Tianliang Sun, and Xinan Xu
Calcul^2: Calculus Calculating Language (QS)
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Kewei Ge, Junde Huang, Zhan Shu, Wenting Yin, and Jinxi Zhao
CHIL: CSS HTML Integrated Language (JS)
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Gil Chen-Zion, Ami Kumar, Annania Melaku, and Isaac White
DJ: MIDI Synthesizer Language Proposal (JR)
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Thomas Elling, William Falk-Wallace, Hila Gutfreund, and Emily Lemonier
FDL: File and Directory Manipulation Language (SE)
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Rupayan Basu, Pranav Bhalla, Cara Borenstein, Daniel Garzon, and Daniel Newman
GAMMA: Strict Yet Fair Language (QS)
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Benjamin Caimano, Weiyuan Li, Matthew Maycock, and Arthy Sundaram
LGA: Language for Graphics and Animation (MZ)
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Yuanli Dong, Pindan Hao, Hang Qian, and Tian Xia
Lullabyte: Music Language (JR)
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Chih-Kai Chang, Louis Croce, Nathan Hayes-Roth, Andrew Langdon, Benjamin Nappier, and Peter Xu
Melody: Music Language (JR)
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   pdf Project Files   
Tong GE, Jingsi Li, and Shuo Yang
SKL: Sketchpad Graphics Language (MZ)
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Yichen Liu, Yan Peng, and Zhongyu WANG
SPWAG: Simple Page Web App Generator (JS)
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Richard Chiou, Aftab Khan, Aditya Majumdar, Yunhe Wang, and Lauren Zou
sIP: Simplified Image Processing (JS)
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Vaibhav Jagannathan, Bhargav Sethuram, and Shubhanshu Yadav
YOLOP: Your Octothorpean Language for Optical Processing (JS)
pdf Proposal   pdf LRM   pdf Final Report   pdf Slides   Archive Project Files   
Lisa Li, Jonathan Liu, and Sasha McIntosh


40 % Project
20 % Midterm
30 % Final
10 % Homework


You will collaborate with your own small group on the programming project, but you may not collaborate with others on homeworks. Groups may share ideas about the programming assignments, but not code. Any two groups 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.


Valid HTML 4.01Valid CSS