15-411: Compiler Design (Fa'12)

Table of Contents
  1. Source Language
    1. C0
  2. Programming Languages for Implementing Compilers
    1. Learning New Programming Languages for 411
    2. Standard ML
    3. Java
    4. Haskell
    5. Scala
    6. Others
  3. Target Languages
    1. x86-64 Machine-Level Programming
    2. IA32 and Assembler Reference Material
    3. LLVM
    4. Java Virtual Machine (JVM)
  4. Tools
    1. GDB
    2. Garbage Collection

Source Language


The labs will use increasingly more complete subsets of the C0 programming language that is designed for the 15-122 Principles of Imperative Computation intro-level course in Computer Science at Carnegie Mellon University. C0 is a safe small subset of the C programming language. C0 has an unambiguously defined semantics. All students are strongly encouraged to learn the C0 language that they will write a compiler for in this course.

Programming Languages for Implementing Compilers

You are free to choose from a subset of programming languages or even different programming languages (caveats apply) as the language for writing your compiler. This course requires you to be familiar with the programming language that you chose. You should learn the language before the course so that you do not struggle with too many difficulties at once.

Learning New Programming Languages for 411

If you want to learn a new programming language for your lab, consider the following. Students are always encouraged to learn new things and new programming languages. Haskell, for example, is also a particularly good language for the labs but you may not have learned it in other courses yet. Because ML, Haskell, and Scala have built-in pattern matching, several transformations are easier to implement than in Java.

If you want to take a peek at the starter code for lab 1 for the various programming languages in order to make up your mind, you can sneak preview it as follows:

svn co https://cvs.concert.cs.cmu.edu/15411-f12/public/lab1/
Keep in mind that you later need to log in with your team account in order to be able to get work done.

Standard ML

Standard ML Implementations: Standard ML Libraries and Documentation:





You are welcome to use other programming languages for implementing compilers. If you choose to do so, however, we cannot provide starter code, but you have to write your own starter code for lab 1. There is no starter code for later labs so this is a one-time setup cost for you, but you are advised to start in time to finish lab 1. We also cannot provide much advice about your favorite programming language. You should carefully read our advice about learning new programming languages for 411.

Target Languages

x86-64 Machine-Level Programming

The following documents will help you fathom the depths of machine-level programming on the x86-64 machines, a 64-bit extension of the Intel instruction set.

  • MSDN x64 calling conventions
  • IA32 and Assembler Reference Material

    The following are for the older Intel x86 architectures. See the newer references above for the x86-64 (also known as IA32-EM64T).


    Java Virtual Machine (JVM)



    Garbage Collection