CS 179E: Compiler Design Project

Winter Quarter 2005: January 3, 2005 - March 11, 2005

Contents

Basics

Catalog Description: Under the direction of a faculty member, students (individually or in small teams with shared responsibilities) propose, design, build, test, and document software and/or hardware devices or systems. Requires a written report, giving details of the project and test results, and an oral presentation of the design aspects. Emphasizes teamwork, making technical presentations, and developing oral and written communication skills.

Prerequisite(s): CS 141: Intermediate Data Structures and Algorithms (with C- or better), CS 152: Compiler Design (with C- or better); 8 additional upper-division units in Computer Science. CS 100: Software Construction and CS 181: Principles of Programming Languages are not required but strongly recommended. You also need good programming skills as well as decent writing/presentation skills to pass this course!

Time Requirements: Four units (12-16 hours/week): lecture/discussion (1 hour/week), laboratory (9 hours/week), individual study (2-6 hours/week; includes reading, writing, and hacking).

Coordinates

Instructor: Peter H. Fröhlich
Office Hours: Monday, Friday, 2:10 pm - 3:00 pm; Wednesday, 4:10 pm - 5:00 pm (email for additional appointments)
Location: Surge, Room 341

Lectures: Monday, 4:10 pm - 5:00 pm
Location: Olmsted Hall, Room 1127

Assistant: Lan Liu
Office Hours: Wednesday, 5:00 pm - 8:00 pm (email for additional appointments)
Location: Surge, Room 350

Lab: Monday, 6:10 pm - 9:00 pm
Location: Surge, Room 283

Mailing List: cs179e@lists.cs.ucr.edu (Archive)

Schedule (Extremely Tentative)

Reports

Imagine working in some company, maybe as a maintenance programmer for existing family of compilers. All of a sudden, you have a "great" idea for a compiler-related project, an idea that you are convinced will be an asset for the company (and an idea that will give you something more interesting to do of course). Now you have to convince your "boss" that you should be given the time (and the money) to work on this project instead of doing your "regular" job. In a nutshell, that's the scenario for this course.

Your "boss" wants three reports during the ten weeks your project runs. Your "boss" is also pretty busy, so the reports should be concise without omitting any required information (he also doesn't read too well these days, but that's beside the point). All reports must be in PDF format, produced using pdflatex, no exceptions. All reports must have a titlepage, giving the necessary information: project name, authors, maybe an abstract; all reports must have a table of contents as well as a list of figures; all reports must have a bibliography, maybe even a glossary and an index.

Proposal

First you need a proposal to convince the "boss" to spend money on your project. The following structure is suggested:

Progress Report

Then you need a progress report to show your "boss" that the money is being spent well, and that you are getting closer and closer to the goal.

Final Report

Finally you need a report that explains how the overall project went, convincing your "boss" that it was indeed a good idea to do the project instead of your normal work.

Projects

Approved Projects

Project Suggestions

Books

There are no required texts for this course. That said, you will still read a lot! However, your readings will largely depend on your particular project, and you will have to do a fair amount of research on your own to figure out what to read. The books I recommend here provide general information that should be useful, but they certainly don't cover everything you will need. There are three broad categories: compiler construction since that's what your project will be about, programming methods since you will hack a lot of code, and software engineering since you need to organize and document your project in a professional manner.

Compiler Construction

Andrew Appel, Jens Palsberg: Modern Compiler Implementation in Java. Cambridge University Press, 2nd edition, 2003. A very popular text covering pretty much every aspect of compiler construction. Discusses a complete example compiler (although the code is not given in full) for a relatively complex language. Some think this is the best compiler text ever written, some think that it's only for people who already know compilers (so you should have less problems, right? :-). All examples are in Java, but editions using C or ML exist as well. The 1st edition is probably good enough as well, and it's available much cheaper.

Keith Cooper, Linda Torczon: Engineering A Compiler. Morgan Kaufmann, 2004. A worthy contender for Appel's throne, this recent text also covers pretty much every aspect of compiler construction. Instead of discussing a complete compiler various case studies are mentioned throughout; a lot of attention is given to forms of intermediate representations, and of course the authors show off their own IR quite a bit. Personally I like this one better than the Appel text, but that's mainly based on presentation, not necessarily on content. Examples are in all kinds of languages, but mostly pseudo-code.

Niklaus Wirth: Compiler Construction. Addison-Wesley, 1996. The most compact introduction to compiler construction I know, from an acknowledged master of the craft. Covers all the essentials (in some way) and also develops a complete compiler. All examples are in Oberon, which might seem weird at first but turns out to be easy to read after a few hours. Sadly, this book is currently out of print. However, thanks to Professor Wirth's generosity, I can offer the complete text for download as a PDF file [6.2 MB]. Thanks are also due to Eric Frohnhoefer for scanning the book. Please do not print this at school! Organize yourselves and have someone print it for all interested students, for example at Kinko's.

Programming Methods

Andrew Hunt, David Thomas: The Pragmatic Programmer. Addison-Wesley, 1999. A wealth of practical advice on various topics relevant to software construction, including design, implementation, testing, debugging, etc. Organized in 46 relatively small "lessons," extensively cross-referenced, including 70 "rules" and several check lists on a reference card. You can download additional material for this book here. An errata is available.

Brian Kernighan, Rob Pike: The Practice of Programming. Addison-Wesley, 1999. Succinct discussion of a variety of programming topics. Deals with style, documentation, design, testing, debugging, portability, etc. Uses several programming languages (C, C++, Java, Perl) and discusses the tradeoffs involved. Includes chapters on basic data structures as well as compilers and interpreters. An errata is available.

Barbara Liskov, John Guttag: Program Development in Java. Addison-Wesley, 2001. Do not be fooled by the title. This is an excellent advanced programming text that deals with many software engineering concerns as well. If you want to learn some Java and along the way pick up lots of programming and design skills, get this book.

Software Engineering

Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides: Design Patterns. Addison-Wesley, 1995. The standard reference for object-oriented design patterns: well-documented solutions to recurring design and implementation problems. The case study in chapter 2 is also a great introduction to object-oriented design and programming. Quite a number of patterns are relevant for compiler construction, most notably Composite and Visitor.

Martin Fowler: UML Distilled. Addison-Wesley, 3rd edition, 2003. Succinct introduction to the Unified Modeling Language (UML) and also a concise summary of basic software engineering and software construction concerns. The 2nd edition is probably good enough as well, and it's available much cheaper.

Carlo Ghezzi, Mehdi Jazayeri, Dino Mandrioli: Fundamentals of Software Engineering. Prentice Hall, 2nd edition, 2003. One of many "standard" software engineering texts, covering the whole software life-cycle. Somewhat more formal than most of its competitors, but still pretty readable. The authors are also well-versed in programming languages and compilers, and discuss a number of case studies relevant for us. You can download the official slides and other material for this book here. An errata is available.

Links

8-bit Processors

Microcontrollers

Operating Systems

Infrastructures

Compilers

Assessment (Extremely Tentative)

Reports (3): 30%, Presentations & Demonstrations (3): 30%, Logs (10): 10%, Participation (10): 10%, Quizzes (3): 10%, Product (1): 10%. See my policies for more information.

Updated: $Id: index.html 433 2005-03-09 03:10:44Z phf $ Validate: XHTML CSS
Copyright © 2005 Peter H. Fröhlich. All rights reserved.