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

Lectures

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

Staff

Name Email Office hours Location
Prof. Stephen A. Edwards sedwards@cs.columbia.edu see my home page 462 CSB
Olivia Byer okb2102@barnard.edu Th 4-6 Open area, 5th floor, CSB
Kuangya Zhai kyzhai@cs.columbia.edu T 2-4 TA Room, 1st Floor, Mudd
Weiyuan Li wl2453@columbia.edu W 1-3 Open area, 5th floor, CSB
Vaibhav Jagannathan vj2192@columbia.edu W 10-12, Th 1-3 TA Room, 1st Floor, Mudd

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

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

Schedule

Date Session Lecture Notes Reading Due
Wed Sep 3 1
Intro. to Languages
pdf
Ch 1, 2
Mon Sep 8 2
2
The Programming Language Landscape
Programming in OCaml
pdf
pdf


Wed Sep 10 3
Guest Lecture: Al Aho
pdf

Mon Sep 15 4
Ocaml contd.

Wed Sep 17 5
Ocaml contd.

Mon Sep 22 6
Ocaml contd.

Wed Sep 24 7
Language Processors
pdf
Ch. 2
Proposal
Mon Sep 29 8
Syntax and Parsing
pdf
Ch. 3, 4
Wed Oct 1 9
"

Mon Oct 6 10
"

Wed Oct 8 11
"

pdf HW1
Mon Oct 13 12
The MicroC Compiler
pdf
App. A
Wed Oct 15 13
"

Mon Oct 20 14
Types and Static Semantics
pdf
Sec. 6.5
Wed Oct 22 15
"

pdf HW2
Mon Oct 27 16
Review for Midterm
pdf

LRM
Wed Oct 29 Midterm
Mon Nov 3 Election Day Holiday
Wed Nov 5 17
Runtime Environments
pdf
Ch. 7
Mon Nov 10 18
"

Wed Nov 12 18
"

Mon Nov 17 19
Code Generation
pdf

Wed Nov 19 20
Bob Martin: There Is No Magic
pdf

Mon Nov 24 21
The Lambda Calculus
pdf

Wed Nov 26 22
"

Mon Dec 1 23
Logic Programming
pdf

pdf HW3
Wed Dec 3 25
Review for Final
pdf

Mon Dec 8 Final Exam
Wed Dec 17 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.

Language Reference Manuals

pdf Dennis M. Ritchie, C Reference Manual
pdf Kernighan & Ritchie, The C Programming Language
pdf The C Language Reference Manual (SGI)
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

Projects

Angela_Z: Matrix Language (KZ)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Fei Liu, Taikun Liu, Jiayi Yan, and Mengdi Zhang
BuckCal: Matrix Manipulation for Expenses (KZ)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Lingyuan He, Ahmad Maruf, Prachi Shukla, Meng Wang, and Lan Yang
ChemLab: Chemical Equation Language (KZ)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Alice Chang, Gabriel Lu, and Martin Ong
Sheets: What's Your Thread Count? (KZ)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Benjamin Barg, Gabriel Blanco, Amelia Brunner, and Ruchir Khaitan
GPL: Graph Programming Language (OB)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Qingxiang Jia, Peiqian Li, and Ephraim Park
GraphQuil: Graph Manipulation Language (OB)
pdfProposal pdfLRM pdfFinal Report ArchiveProject Files
John Heizelman, Jonhatan Paul, Gemmarose Ragozzine, and Steven Weiner
StateMap: DFA Language (OB)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Oren Finard, Jackson Foley, Alexander Peters, Brian Yamamoto, and Zuokun Yu
n2n: Relational Graphing Language (OB)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Elisheva Aeder, Nicholas Falba, Jialun Liu, and Johan Mena
DSP_Jockey: Signal Processing Language (SE)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Brian Bourn, Abhinav Mishra, Addisu Petros, and Vanshil Shah
EGUI: Graphical User Interface Language (SE)
pdfProposal
Mehul Shah
EZMath: Math Typesetting Language (SE)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Zhejiao Chen, Piaoyang Cui, Yi Wang, and Shangjin Zhang
FRY: Flat File Data Processing Language (SE) star
pdfProposal pdfLRM pdfFinal Report ArchiveProject Files
Thomas DeVoe
Nifty50: Concise Programming Language (SE)
pdfProposal pdfLRM pdfFinal Report ArchiveProject Files
AMSarwar Jahan
Super-Serial: Data Serialization Language (SE)
pdfProposal pdfLRM pdfFinal Report ArchiveProject Files
Douglas Kaminsky
Civ: Distributed CSV Processing Language (VJ)
pdfProposal pdfLRM pdfFinal Report Powerpoint FileSlides ArchiveProject Files
Eli Bogom-Shanon, Michael Nguyen, Prateek Sinha, and Yuchen Zeng
JO: JSON Language (VJ)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Abhinav Bajaj, Sriharsha Gundappa, Arpit Gupta, and Chase Larson
Photoshop--: Graphics Language (VJ)
pdfProposal pdfLRM pdfFinal Report ArchiveProject Files
Gilbert Feig, David Figueroa, and Alana Ramjit
Qlang: Quantum Computing Language (VJ) star
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Christopher Campbell, Clement Canonne, Sankalpa Khadka, Winnie Narang, and Jonathan Wong
corgi: Music Language (VJ)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Philippe-Guilla Losembe Botumbe, Melissa O'Sullivan, Alisha Sindhwani, and Justin Zhao
quark: Quantum Computing Language (VJ)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Linxi Fan, Jamis Johnson, Daria Jung, and Parthiban Loganathan
rapid: Web API Language (VJ)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Nate Brennand, Benjamin Edelstein, Brendon Fish, Daniel Schlosser, and DongHee Shin
GAWK: RPG Language (WL)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Albert Cui, Karen Nan, Michael Raimi, and Mei-Vern Then
SNL: Role-playing Game Language (WL)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
James Lin, Alex Liu, Daniel Maxson, and Andre Paiva
do-fifty-two: Card Game Language (WL)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Yichi Liu, Jayson Ng, William Target, Josephine Tirtanata, and Yunfei Wang
pumpkin: Functional Language (WL)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Joshua Boggs, Christopher Evans, Gabriela Melchior, and Clement Robbins

Grading

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

Collaboration

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.

Other

Valid HTML 4.01Valid CSS

CVN faculty center