Compiler Design and Implementation
Semester: Spring 2011

Course Information

  • Instructor: Hongwei Xi (email: hwxi AT cs DOT bu DOT edu)
  • Instructor's Office: MCS 172
  • Instructor's Office Hours: M (3-5); Tu (5-6); Th (5-6)
  • Grader: None
  • Lecture Times: Tuesday & Thursday 2:00-3:30 PM
  • Classroom: MCS B29, 111 Cummington Street
  • The midterm exam is a one-and-one-half hour in-class exam scheduled on Thursday, March 10, 2011
  • There is no written final exam for this class. Instead, please turn in your compiler project.
  • Overview

    Compiler Design and Implementation is a course that introduces students to some basics in the design and implementation of compilers. In this course, we are to teach the theory behind various components of a compiler and the programming techniques involved to put the theory into practice. ATS is the chosen programming languauge for implementation. We plan to start from language design and finish with a compiler that can generate some form of executable object code.



    Reference Books

  • Programming in ATS
  • Modern Compiler Implementation in ML by Andrew W. Appel. ISBN 0-521-58274-1. Cambridge University Press.
  • Introduction to the Theory of Computation, by Michael Sipser. ISBN 0-534-95651-3. PWS Publishing Company, 20 Park Plaza, Boston, MA 02116.
  • ML for the Working Programmer by Lawrence C. Paulson. ISBN 0-521-57050-6 (hardback) and 0-521-56543-X (paperback). Cambridge University Press.
  • Elements of ML Programming by Jeffery D. Ullman. ISBN 0-13-790387-1. Prentice-Hall.
  • Prerequisites

  • Familiarity with programming in general.
  • CS320 (Concepts of Programming Languages)
  • Programming Languages

  • ATS (meta language)
  • Logistics

  • Syllabus (ps)(pdf)
  • Schedules
  • Guidelines for Homework Submission (ps) (pdf)
  • How to use gsubmit to submit homework?
  • Archived Messages(new!)
  • Slides

  • Introduction (ppt) (ps)
  • Parsing Combinators (ppt) (ps)
  • Notes

  • Untyped Lambda-Calculus (pdf) (ps)
  • Simply-Typed Lambda-Calculus (pdf) (ps)
  • Code

  • 2011-01-18 (Tuesday)
  • 2011-01-20 (Thursday)
  • 2011-01-25 (Tuesday)
  • 2011-01-27 (Thursday)
  • 2011-02-03 (Thursday)
  • 2011-02-08 (Tuesday)
  • Mailing List

  • The class mailing-list is cascs525a1-l@bu.edu. Please find information on using the mailing-list here.
  • Class Calendar

  • Class begins on Tuesday, January 18, 2011
  • No Class. Substitute Monday Schedule of Classes Tuesday, February 22, 2011
  • Midterm Exam is a one-hour in-class exam scheduled on Thursday, March 10, 2011
  • Spring Recess Saturday, March 12, through Sunday, March 20, 2011
  • No Class. Substitute Monday Schedule of Classes Thursday, April 21, 2011
  • Last Day of Instruction, Thursday, May 5, 2011
  • Assignments

  • Assignment 1 (01): Some warmup exercises on programming in ATS (Due on Thursday, the 3rd of February, 2011))
  • Assignment 2 (02): Please implement a symbol table and an interpreter for raw abstract syntax trees (Due on Thursday, the 10th of February, 2011))
  • Assignment 3 (03): Please write some simple programs in STFPL (Due on Tuesday, the 15th of February, 2011))
  • Assignment 4 (04): Please implement typechecking for STFPL (Due on Tuesday, the 22th of February, 2011))
  • Assignment 5 (05): Please implement typechecking for STFPL based on a form of type inference (Due on Tuesday, the 1st of March, 2011))
  • Assignment 6 (06): Please implement A-normalization on level-1 expressions (Due on Tuesday, the 8th of March, 2011))
  • Assignment 7 (07): Please implement an emitter that emits C code based on the IR tree in your code for Assignment 6. (Due on Tuesday, the 22nd of March, 2011))
  • Solutions