Re: How to justify teaching compilers (Torben Ęgidius Mogensen)
9 Oct 2004 22:32:21 -0400

          From comp.compilers

Related articles
[3 earlier articles]
Re: How to justify teaching compilers (Max Hailperin) (2004-10-02)
Re: How to justify teaching compilers (=?ISO-8859-1?Q?J=FCrgen_Kahrs?=) (2004-10-04)
Re: How to justify teaching compilers (Tomasz Kowaltowski) (2004-10-04)
Re: How to justify teaching compilers (Gene Wirchenko) (2004-10-04)
Re: How to justify teaching compilers (John Slimick) (2004-10-04)
Re: How to justify teaching compilers (2004-10-09)
Re: How to justify teaching compilers (2004-10-09)
Re: How to justify teaching compilers (Stefan Monnier) (2004-10-09)
Re: How to justify teaching compilers (Randy) (2004-10-09)
Re: How to justify teaching compilers (2004-10-09)
Re: How to justify teaching compilers (Ron House) (2004-10-09)
Re: How to justify teaching compilers (Rodney M. Bates) (2004-10-12)
| List of all articles for this month |

From: (Torben Ęgidius Mogensen)
Newsgroups: comp.compilers
Date: 9 Oct 2004 22:32:21 -0400
Organization: Department of Computer Science, University of Copenhagen
References: 04-10-009
Keywords: courses
Posted-Date: 09 Oct 2004 22:32:21 EDT

"Pg Nor Jaidi Pg Tuah" <> writes:

> With the fast expanding frontier of computer science, and the
> (unreasonable) expectation that CS graduates be fully "productive"
> from day 1 of their work, CS curriculum must include more "hot"
> topics, squeezing out "old fashioned" stuff.
> Thus I find my "compiler is fun" argument losing to "compiler
> knowledge is not so useful anymore" argument, especially when more
> than half of the students would likely find the subject terribly
> difficult. If you are in this situation, and you have no strong
> compiler research group to back you up (if you have a compiler
> research group, you wouldn't be in this situation, would you?), how
> would you justify keeping/introducing your beloved compiler course?

In my notes on compilers, I have included the following motivations:

  1) A good craftsman should know his tools, and compilers are important
        tools for programmers and computer scientists.

  2) The techniques used for constructing a compiler are useful for
        other purposes as well.

  3) There is a good chance that a programmer or computer scientist will
        need to write a compiler or interpreter for a domain-specific

To elaborate a bit on these:

Ad. 1): Understanding how a compiler is built will allow programmers
to get an intuition about what their high-level programs will look
like when compiled and use this intuition to tune programs for better
efficiency. Furthermore, the error reports that compilers provide are
often easier to understand when one knows about and understands the
different phases of compilation, such as knowing the difference
between lexical errors, syntax errors, type errors and so on.

Ad. 2): The techniques used for reading (lexing and parsing) the text
of a program and converting this into a form that is easily
manipulated by a computer, can be used to read and manipulate any kind
of structured text such as XML documents, adress lists, etc.

Ad. 3): This is becoming more and more important as domain specific
languages (DSL's) are gaining in popularity. A DSL is a (typically
small) language designed for a narrow class of problems. Examples are
data-base query languages, text-formatting languages, scene
description languages for ray-tracers and languages for setting up
economic simulations. The target language for a compiler for a DSL
may be traditional machine code, but it can also be another high-level
language for which compilers already exist, a sequence of control
signals for a machine, or formatted text and graphics in some
printer-control language (e.g. PostScript). Even so, all DSL
compilers will share similar front-ends for reading and analysing the
program text.

> If you can compromise and reduce compiler to just a few hours of
> lectures (embedded in, say, "systems programming"), what would you
> cover?

This is a tough nut. With just a few hours, I can't really see that
you can do much more than describe the purpose of the different phases
of a compiler without going into details of the how. You could,
maybe, focus on the compilers-as-tools aspect and enable students to
understand the difference between lexical, syntax and type error
messages, and possibly also make them have a feel for what type of
code different language constructs generate.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.