CU website


Software project

Theory Application



Compiler Construction: Three Sample Courses

The broadening of computer science education has called into question the roles of many traditional core courses. ACM's Curriculum 2001 defines a course called ``Programming Language Translation'' (CS240s):

Introduces the theory and practice of programming language translation. Topics include compiler design, lexical analysis, parsing, symbol tables, declaration and storage management, code generation, and optimization techniques.

Unfortunately, it is impossible to cover all of this material, in depth, in a single course. A complete compiler, especially one coded by hand, is a large program for students at the undergraduate and first-year graduate level. Moreover, that program has three major tasks (analysis, transformation, and resource allocation) with very different characteristics. The result is that what the students carry away with them is the memory of late-night coding marathons and a mish-mash of techniques for solving very specific problems posed by a particular source language and target machine.

If we are to continue offering a course in this area, we need a viable strategy that will allow us to make consistent decisions about viewpoint, depth of coverage, and detailed tactics resulting in a coherent view of the subject. Course design must take the overall goals of the curriculum and the prerequisites into account, providing the necessary bridges between old and new material. The Compiler Course in Today's Curriculum: Three Strategies, presented at SIGCSE06, details the following successful approaches:

  • Software project: Emphasize design patterns, teamwork, and programming methodology by constructing a compiler to meet assigned specifications.

  • Application of theory: Emphasize the role of theory to enable automation of compiler tasks, and illustrate the limitations of that theory.

  • Support for communicating with a computer: Emphasize the broad applicability of compiler technology to implement languages for special purposes.

Each strategy provides the professor with a rationale for making decisions about the selection of material to cover, assignments to give, and tools to use. Here is a summary of possible choices discussed in the paper:

Goals Apply software
engineering techniques
Relate theory to practice Learn to build
domain-specific generators
Material Compiler decomposition
Re-use of solutions
Agile methodology
Formal language applications
Attribute grammar applications
Tree automata applications
Language analysis
Abstract representation
Tool use
Assignments Compiler project Tools based on theory Application generators
Tools Scanner/parser generator
Design patterns
Class libraries
Scanner/parser generator Compiler toolkit

It should be emphasized that these are examples that have been found to work in practice. Each link on the navigation bar to the left leads to material from a course taught at the University of Colorado using the given strategy. The following meta-information has been added to the home page for each of those courses:

  • Focus: what is the viewpoint taken by the course?
  • Outcomes: what skills should the students gain from the course?
  • Concepts: what are the major points to be conveyed?
  • Assignments: what will help to cement the concepts for the students?
  • Tools: what support infrastructure is used?
The important point, however, is that the professor should make the choices based on the learning objectives, and be able to explain to the students why those choices were made. Without such a rationale, students who believe that they will never write a compiler don't have a clear picture of why they should study this material.
Revision 1.0 (2006/02/14 16:51:58)