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

General Information

Class meets Mondays and Wednesdays, 1:10 - 2:25 in 535 Mudd.

Staff

Name Email Office hours Location
Prof. Stephen A. Edwards sedwards@cs.columbia.edu T 4-5, W 3-4 462 CSB
Rajesh Venkataraman rv2187@columbia.edu T 1:30-3:30 TA Room
Nalini Vasudevan naliniv@cs.columbia.edu Th 2-4 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
September 3 Intro. to Languages pdf Ch. 1, 2
September 8 The C Language Reference Manual pdf
September 10 "
September 15 Scripting Languages pdf Ch. 2
September 17 Introduction to O'Caml pdf
September 22 "
September 24 " Proposal
September 29 Language Processors pdf Ch. 2
October 1 Syntax and Parsing pdf Ch 3, 4
October 6 "
October 8 Getting it right pdf HW1 pdf
October 13 Ocamlyacc and ASTs pdf Ch. 4, 5
October 15 Names, Scope, and Bindings pdf Ch. 6 HW2 pdf
October 20 "
October 22 Small Examples pdf App. A LRM
October 27 Midterm review pdf
October 29 Midterm
November 3 Election Day Holiday
November 5 Types pdf Ch. 6
November 10 "
November 12 Control-flow pdf Ch. 6
November 17 "
November 19 Code Generation pdf Ch. 6, 7, 8
November 24 Logic Programming pdf
November 26 Functional Programming pdf HW3 pdf
November 27-28 Thanksgiving Holiday
December 1 Concurrency pdf
December 3 Review for final pdf
December 8 Final Exam
December 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

This Term's Projects

MATLIP: MATLAB-like Language for Image Processing (NV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report    Powerpoint fileSlides    Compressed Tar ArchiveProject Files   
Pin-Chin Huang    Shariar Kazi    Shih-Hao Liao    Pohsu Yeh   
TablePro: Table Generation Language (RV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report   
Rajat Dixit    Anureet Dhillon    Lakshmi Nadig   
culog: Entity Interaction Simulation Language (RV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report    PDF fileSlides   
John Demme    Nishant Shah    Devesh Dedhia    Cheng Cheng   
[K]AML: Array Manipulation Language (NV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report    PDF fileSlides   
Kaori Fukuoka    Ankush Goel    Maninder Singh    Mayur Lodha   
VOPL: Video Processing Language (NV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report    PDF fileSlides    Compressed Tar ArchiveProject Files   
Baolin Shao    Huning Dai    Jia Li    Xuyang Shi   
FVPL: Fast Vector Processing Language (SE)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report    PDF fileSlides    Compressed Tar ArchiveProject Files   
Ravindra Babu Ganapathi    Gowri Kanugovi    Pratap Prabhu   
CRYPS: Cryptographic Algorithm Language (RV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report   
Sarfraz Nawaz    Minita Shah    Saket Goel    Hsiu-Yu Huang   
WebAppQA: A Language for Testing Web Applications (NV)

Adrian Frei    Ankit Malhotra    Roy Han   
SBML: Shen Bi Ma Liang/Magic Pen Boy (NV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report   
Bin Liu    Yiding Cheng    Hao Li    Wenhan Zhang   
CABG: Deterministic Finite Automaton Language (RV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report    Zip ArchiveProject Files   
Brody Berg    Shaina Graboyes    Max Czapanskiy    Raphael Almeida   
MCSL: Monte Carlo Simulation Language (SE)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report   
Yunling Wang    Chong Zhai    Diego Garcia    Eita Shuto   
SHIL: Simuated Human Interaction Language (RV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report    PDF fileSlides   
Moses Vaughan    Chun Yai Wang    Binh Vo    Ian Vo   
PCGSL: Playing Card Game Simulation Language (RV)
PDF fileProposal    PDF fileFinal Report   
Yuriy Kagan    Andrew Shu    Enrique Henestroza    Peter Tsonev   
TMSL: Turing Machine Simulation Language (SE)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report    PDF fileSlides    Compressed Tar ArchiveProject Files   
Isaac McGarvey    Joshua Gordon    Keerti Joshi    Snehit Prabhu   
DruL: Drumming Language (RV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report    PDF fileSlides   
Robert Stewart    Thierry Bertin-Mahieux    Benjamin Warfield    Waseem Ilahi   
MatrEL: Matrix Entertainment Language: A Board Game Creation Language (NV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report   
Rochelle Palting   
ltc: Less Than C (SE)
PDF fileProposal    PDF fileFinal Report    Compressed Tar ArchiveProject Files   
Nicolas Viennot   
INC: Integrated Network Control Language (SE)
PDF fileProposal   
pip: Card Game Language (RV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report    Compressed Tar ArchiveProject Files   
Francis Wallingford   
TBSL: Turn-based Simulation Language (RV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report    Zip ArchiveProject Files   
Vencislav Stanev   
MOC-V: A Language for Testing Web Applications (SE)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report    Compressed Tar ArchiveProject Files   
Benjamin Panning   
Card-Games: A Language for Card Games (RV)
PDF fileProposal    PDF fileLRM    PDF fileFinal Report   
Jeffrey Wong   

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.

Valid HTML 4.01 Valid CSS