CPS 196.1, Fall 1999
Modern Compiler Design
In this course we build a fairly complete compiler from scratch. In a hands-on
approach, we cover all important aspects of compiler writing, and code
all concepts covered in the classroom. From the preface of the textbook
(...) In this introductory course in compilers, students will see
the theory behind different components of a compiler, the programming techniques
used to put the theory into practice, and the interfaces used to modularize
the compiler. To make the interfaces and programming examples clear and
concrete, a variety of programming languages is used (SML, Java,
C).
The ?student project compiler? is reasonably simple, but is organized
to demonstrate some important techniques that are now in common use: Abstract
syntax trees to avoid tangling syntax and semantics, separation of instruction
selection from register allocation, sophisticated copy propagation to allow
greater flexibility to earlier phases of the compiler, and careful containment
of targetmachine dependencies to one module.
The compiler will be written in SML, a high-level programming language
explicitly designed for programming language research and automated reasoning.
We will also have access to lexical analysis and parser generators (ML-Lex
and ML-Yacc). The source language that our compiler will process is Tiger,
a Pascal-like programming language with nested scope and heap-allocated
records. The target code, the output of our compiler, will be assembly
for the ManArray SP, a high-performance digital signal processor by BOPS
Inc. Students are not expected to know SML, Tiger or BOPS assembly, but
they must have some general programming experience. Although some of the
following concepts will be covered in class, students should have heard
before of:
-
Regular and context-free grammars, push-down automata theory.
-
Modern programming language concepts such as strong typing, scope rules,
user-defined datatypes, activation records, garbage collection.
-
Advanced programming techniques, efficient datatypes and some elements
of software engineering.
Schedule: Tuesday & Thursday, 3:50-5:05, D106 LSRC
Grading: 50% Homework Assignments, 20% Midterm, 30% Final Project
Office Hours: to be announced.
Instructor:
Nikos Pitsianis
http://www.cs.duke.edu/~nikos/CV/
LSRC D105
email://nikos@cs.duke.edu