Stephen A. Edwards Columbia University Crown
COMS W4115
Programming Languages and Translators
Spring 2016

Lectures

Class meets Mondays and Wednesdays 2:40 - 3:55 PM 209 Havemeyer.

Staff

Name Email Office hours Location
Prof. Stephen A. Edwards sedwards@cs.columbia.edu see my home page 462 CSB
Yu-Chun (Julie) Chien yc2937@columbia.edu Friday 3:00 - 5:00 TA Room (Mudd 1st floor)
Rachel Gordon rcg2130@columbia.edu Tuesday 10:30 AM - 12:30 TA Room
Daniel Echikson dje2125@columbia.edu Wednesday 12:15 - 2:15 TA Room
David Watkins djw2146@columbia.edu Monday 12:00 - 2:00 CS Lounge
Jacob Graff jag2302@columbia.edu Wednesday 4:00 - 6:00 CS Lounge

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 Jan 20 1
Intro. to Languages
pdf
Ch 1, 2
Mon Jan 25 2
Language Processors
pdf
Ch. 2
Wed Jan 27 3
Programming in OCaml
pdf

Mon Feb 1 4
Some Outstanding Projects
pdf

Wed Feb 3 5
"

Mon Feb 8 6
"

Wed Feb 10 7
Syntax and Parsing
pdf
Ch. 3, 4
Proposal
Mon Feb 15 8
"

Wed Feb 17 9
"

pdf HW1
Mon Feb 22 10
"

Wed Feb 24 11
The MicroC Compiler
pdf
App. A
Mon Feb 29 12
"

Wed Mar 2 13
"

pdf HW2
Mon Mar 7 14
Review for Midterm
pdf

LRM
Wed Mar 9 Midterm Exam
Mar 14-18 Spring Break
Mon Mar 21 15
Types and Static Semantics
pdf
Sec. 6.5
Wed Mar 23 16
Bob Martin: There Is No Magic
pdf

Mon Mar 28 17
Types and Static Semantics contd.

Wed Mar 30 18
Runtime Environments
pdf
Ch. 7
Mon Apr 4 19
"

Wed Apr 6 20
"

Hello World
Mon Apr 11 21
Code Generation
pdf

Wed Apr 13 22
The Lambda Calculus
pdf

Mon Apr 18 23
"

Wed Apr 20 24
Logic Programming
pdf

pdf HW3
Mon Apr 25 25
Parallel Programming
pdf

Wed Apr 27 26
Review for Final
pdf

Mon May 2 Exam
May 11 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.
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 OCaml source for the four-function calculator.
.tar.gz file 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.

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 An excellent final report: the Funk language by 4115 students Naser AlDuaij, Senyao Du, Noura Farra, Yuan Kang, and Andrea Lottarini.
pdf An excellent final report: the Sheets language by 4115 students Benjamin Barg, Gabriel Blanco, Amelia Brunner, and Ruchir Khaitan.

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

Projects

Fly: Language for Distributed Systems (DE) star
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Carolyn Sun, Hsiang-Ho Lin, Shenlong Gu, and Xin Xu
RockyII: General-purpose Language (DE)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Anish King, and Un Sung Yoo
Stop: Simple Functional Object-Oriented Language (DE)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
James Stenger, Jillian Knoll, Jonathan Barrios, and Lusa Zhan
eqeq: Symbolic Math Language (DE)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Jonathan Zacsh, Lanting He, Nam Hoang, Ruicong Xie, and Tianci Zhong
Democritus: An Atomic Language (DW)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Amartya Rajaram, Emily Pakulski, Kyle Lee, and Xin Xu
JSJS: Strongly Typed Language for the Web (DW) star
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Ayush Jain, Bahul Jain, Gaurang Sadekar, and Prakhar Srivastav
JaTeste: Testing-oriented language (DW)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Andrew Grant, Jake Weissman, Jared Weiss, and Jemma Losh
VLSC: GPU-Targeted Language (DW)
pdfProposal pdfLRM pdfFinal Report ArchiveProject Files
David Chen, Diana Valverde-Paniagua, and Kellie Lu
BMWSA: Data Processing Langauge (JC)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Aman Chahar, Baokun Cheng, Miao Yu, Sikai Huang, and Weiduo Sun
GBL: Game Building Language (JC)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Shengtong Zhang, Sihao Zhang, Ye Cao, and Yiqing Cui
GridLok: 2D Game Language (JC)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Alice Hwang, Bryan Yu, Julian Edwards, and Laura Hu
PICEL: Picture Editing Language (JC)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Chang Liu, Chia-Hao Hsu, Chih-Sheng Wang, Rui Lu, and Ruijie Zhang
ALBS: A Language with Beautiful Syntax (JG)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Brennan Wallace, and Suhani Singhal
GOBLAN: Graph Object Language (JG) star
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Da Liu, Jee Hyun Wang, Sameer Lal, Sean Garvey, and Yunsung Kim
ML: Matrix Language (JG)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Alexander Barkume, Caroline Trimble, Jared Greene, Jessica Valarezo, and Kyle Jackson
DaMPL: Data Manipulation Programming Language (RG)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Bernardo De Almeida Abreu, Felipe Teixeira da Rocha, Henrique Pizzol Grando, and Hugo Araujo de Sousa
Scolkam: Python-Like Language (RG)
pdfProposal pdfFinal Report pdfSlides ArchiveProject Files
Connor Hailey, Leopold Mebazaa, Megan O'Neill, Steve Cheruiyot, and Yekaterina Fomina
plOtter: Language for Data Graphing (RG)
pdfProposal pdfLRM
Ibrahima Niang, Ranjith Kumar Shanmuga Visvanathan, and Sania Arif
tail: Tail Recursion Optimization Language (RG)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Fiona Rowan, Jennifer Lam, Sandra Shaefer, and Serena Shah-Simpson
PAL: PDF Automation Language (SE)
pdfProposal pdfLRM pdfFinal Report pdfSlides ArchiveProject Files
Anshuman Singh, Diksha Vanvari, Vinay Gaba, and Viral Shah
TENLAB: Multi-Dimensional Array Language (SE)
pdfProposal pdfLRM
Dallas Jones, Mehmet Turkcan, and Yusuf Cem Subakan

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