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

Lectures

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

Staff

Name Email Office hours Location
Prof. Stephen A. Edwards sedwards@cs.columbia.edu TBA 462 CSB
Thomas Rantasa tr2286@columbia.edu F 12:30 - 2:30 Mudd TA Room
Jared Pochtar jpochtar@gmail.com Th 4-6 Mudd TA Room
Jiabin Hu jh3240@columbia.edu W 2-4 Mudd TA Room
Shuai Sun ss4088@columbia.edu T 1:30-3:30 Mudd TA Room
Bonan Liu bl2432@columbia.edu F 3-5 Mudd TA Room
Yan Zou yz2437@columbia.edu Th 1-3 Mudd TA Room

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 Lecture Notes Reading Due
Sep 5 Intro. to Languages
pdf
Ch 1, 2
Sep 10 The C Language Reference Manual
pdf

Sep 12 Introduction to O'Caml
pdf

Sep 17 "

Sep 19 "

Sep 24 "

Sep 26 Language Processors
pdf
Ch. 2
Proposal
Oct 1 Syntax and Parsing
pdf
Ch. 3, 4
Oct 3 "

Oct 8 "

Oct 10 "

Oct 15 Getting it right
pdf

Oct 17 Ocamlyacc and ASTs
pdf

pdf File HW1
Oct 22 The MicroC Compiler
pdf
App. A
Oct 24 "

pdf HW2
Oct 29 Hurricane Sandy
Oct 31 Midterm Review
pdf

LRM
Nov 5 Election Day
Nov 7 Midterm
Nov 12 Names, Scope and Bindings
pdf
Ch. 6
Nov 14 Types
pdf
Ch. 6
Nov 19 "

Nov 21 Control-flow
pdf
Ch. 6
Nov 26 Code Generation
pdf
Ch. 6, 7, 8
Nov 28 Logic Programming
pdf

pdf HW3
Dec 3 The Lambda Calculus
pdf

Dec 5 Final Review
pdf

Dec 10 Final Exam
Dec 19 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

Projects

ALG: A Language for Geometry (BL)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Qiang Deng, Qingye Jiang, Ainur Rysbekova, Mengqi Zhang, and Shiyao Zhu
Cardigan: Card Game Development and Implementation Language (JP)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Muzi Gao, Joshua Lopez, and Miriam Melnick
Cb: C Flat (BL)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Matthew Cowan, Cole Diamond, Mehmet Erkilic, Marcellin Nshimiyimana, and Kyle Rego
Drone-War: The Drone War (JH)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
George Brink, Xiaotong Chen, Shuo Qiu, and Xiang Yao
EC: Easy Circuit (YZ)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Yingnan Li, Lei Zhang, Liming Zhang, Wei Zhang, and Xingyue Zhou
EZ-ASCII: ASCII Art Language (TR)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Dmitriy Gromov, Joe Lee, Yilei Wang, Xin Ye, and Feifei Zhong
EasKey: Keyboard and Mouse Actions (JH)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Keqiu Hu, Jinqi Huang, Xiaoyu Huang, Zongheng Wang, and Lizhong Zhang
Funk: Parallel Programming Language (SE) star
pdfProposal pdfLRM pdfFinal Report ArchiveProject Files
Naser AlDuaij, Senyao Du, Noura Farra, Yuan Kang, and Andrea Lottarini
MatCab: Matrix Manipulation Language (SS)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Yu Qiao, Cheng Xiang, Tianchen Yu, and Ran Yu
NCML: Nodal Computation ML (JP)
pdfProposal pdfLRM pdfFinal Report ArchiveProject Files
Oscar Batori, Nina Berg, Victor Frenkel, and Venkata Yamajala
RetroCraft: Retro Platform Game Language (TR)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Lucy He, Kevin Lin, Fernando Luo, and Papoj Thamjaroenporn
Spidr: HTML Crawler (SE)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Alexander Dong, Katherine Haas, Matthew Meisinger, and Akshata Ramesh
Stint: String and Integer Language (SS)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Tingting Ai, Sichang Li, Jiang Wu, Ningning Xia, and Yiming Xu
TSC:
pdfFinal Report ArchiveProject Files
Nithin Chandrasekharan
TaML: Table Manipulation Language (SS)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Le Chang, Adam Dossa, Qiuzi Shangguan, and Maria Taku
TrML: Trigonometry Manipulation Language (SS)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Qishu Chen, Xuechen Feng, Lianhao Qu, Yu Wan, and Wanqiu Zhang
WarmFusion: HTML Generation Language (SE)
pdfProposal pdfLRM pdfFinal Report ArchiveProject Files
Robert Dong
aML: a-Mazing Language (BL)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Sriramkumar Balasubramanian, Evan Drewry, Timothy Giel, and Nikil Helferty
cgl: Card Game Language (YZ)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Kevin Henrick, Ryan Jones, Mark Micchelli, and Hebo Yang
chartlan: A Language for Charts (JH)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Ziyue Chen, Xiuming Dou, Xiang Ma, Xiao Xu, and Yibo Zhu
curve: Vector graphics manipulation language (TR) star
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Kun An, John Chan, David Mauskop, Wisdon Adinoyi Omuya, and Zitong Wang
fogl: Figure Oriented Graphics Language (JP)
pdfProposal pdfLRM pdfFinal Report ArchiveProject Files
Evgenia Nitishinskaya, Julian Rosenblum, and Richard Zou
iCalendar: Event management language (YZ)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Jiacheng Chen, Yun Feng, Chang Hu, Yu Kang, and Mengfei Ren
masl: Multi-Agent Simulation Language (BL)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Jiatian Li, Wei Wang, Chong Zhang, and Dale Zhao
pbj: Parallel Boxes and Jam (YZ) star
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Hahn Chong, Fred Clark, Rotem David, Jose Rodriguez, and Robert Tolda
scam: String Computation Program (SE)
pdfProposal pdfLRM pdfFinal Report ArchiveProject Files
Scott Pender

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