File Pedagogy.html    Author McKeeman    Copyright © 2007    index

Pedagogy

You are lying, the student said.
You are learning, the teacher replied.

Motivation

My vision

Teaching Approach

The material is suitable for advanced undergraduate or beginning graduate study.

The approach is to learn through doing. A course project, enchancing a small compiler, is the centerpiece of the course in an academic setting. Completing a project will take the student into each phase of the small compiler, and therefore into such theory as is necessary to understand how the parts and the whole work.

Because I learn better from examples, and then generalizing, that is the way this material is presented. If you prefer to learn the general case first, you might choose to access the pages in a different order.

The treatment is complete, from source text to making and executing machine language.

Presentation

Several file types are used in the presentation. Where mathematical typesetting is required, the material is in PDF generated from LaTeX. Some of the material was produced in MicroSoft PowerPoint, then saved in PDF format. The dot-PPT files are also retained. This PPT option was used when the graphics was convenient, and also to replace the proverbial talking-head-at-the-whiteboard with a sequence of pages showing dynamic behavior. The rest of the pages are in hand-produced HTML.

In-program documentation of M files is provided so as to be accessible to the MATLAB HELP function. Usually a description of the interface shows in the help and more detailed internal descriptions follow, separated by a blank line from the help material. The details are examined by looking at the source file itself.

Implementation Language

Compilers, like other systems programs, are executed often and must therefore be "as fast as possible," whatever that means to the reader. The xcom compiler, on the other hand, is changed often. MATLAB usability is more suitable to the xcom goals than C/C++ efficiency. A linux-based C++ implementation of xcom is available as a starting point for a student who wants to "move up" to a production compiler still based on language X. For those really interested in compiler speed, a linux-based C implementation called hyper implementing a lot of speed-up tricks is also available.

The course does not depend on or explain popular compiler component generators (such as lex, yacc). It also does not use vendor-supplied components such as assemblers, linkers and loaders. Except, of course, MATLAB itself.

Mathematics

All programmers like formulas -- they write them every day. But some programmers do not like mathematics. It seems that these programmers like to do things rather than prove things. In this course mathematical formulas are used to describe things, so the math-adverse might want to avoid jumping to conclusions at the first appearance of α. The reader is expected to be comfortable with logic, sets and relations, familiar with computer hardware, and competent in MATLAB.

The mathematical notation not only serves as a concise and intellectually satisfying means of expressing compiler theory, but also serves as a source of ideas for extensions to the compiler. All the notation used in the descriptions is summarized separately.

Thank You

These pages contain many ideas. The presentation is, of course, the responsibility of this author. The ideas are credited to the original source when I know it. My personal coaches have included Niklaus Wirth, Dave Dahm, Jim Horning, Dave Wortman, John Guttag, Roy Levin, Bill Rousseau, Frank DeRemer, Tom Pennello, Gary Pollice, Bob Morgan, Alan Martin, Neil Faiman, Chip Nylander, Mike Karr, John Micco, Steve Johnson, Michael Fromberger, Hongjun Zheng, Luther Johnson, the membership of the IFIP Working Group on Programming Methodology and more than 1000 students who have taken my course. My everyday reference is the Dragon Book by Aho, Sethi and Ullman. My usual compiler course text is Modern Compiler Implementation in C by Appel.