Re: Teaching compilers backwards?

Randy Crawford <rand@rice.edu>
15 Mar 2004 09:32:12 -0500

          From comp.compilers

Related articles
[3 earlier articles]
Re: Teaching compilers backwards? hat@se-126.se.wtb.tue.nl (Albert Hofkamp) (2003-10-08)
Re: Teaching compilers backwards? rmatthewk@hotmail.com (2003-10-08)
Re: Teaching compilers backwards? joachim.durchholz@web.de (Joachim Durchholz) (2003-10-12)
Re: Teaching compilers backwards? peter_flass@yahoo.com (Peter Flass) (2003-10-13)
Re: Teaching compilers backwards? Brian.Inglis@SystematicSw.ab.ca (Brian Inglis) (2003-10-13)
Re: Teaching compilers backwards? michael.l.ross@intel.com (Michael Ross) (2004-03-11)
Re: Teaching compilers backwards? rand@rice.edu (Randy Crawford) (2004-03-15)
Re: Teaching compilers backwards? zork_666@nospammail.net (Johnathan) (2004-03-15)
Re: Teaching compilers backwards? romesamo@earthlink.net (Rome Samo) (2004-03-19)
Re: Teaching compilers backwards? aycock@cse.cpsc.ucalgary.ca (John Aycock) (2004-03-19)
Re: Teaching compilers backwards? lex@cc.gatech.edu (Lex Spoon) (2004-03-19)
Re: Teaching compilers backwards? k301x@yahoo.com (dtf) (2004-03-19)
Re: Teaching compilers backwards? vbdis@aol.com (2004-03-19)
[5 later articles]
| List of all articles for this month |

From: Randy Crawford <rand@rice.edu>
Newsgroups: comp.compilers
Date: 15 Mar 2004 09:32:12 -0500
Organization: Rice University, Houston, TX
References: 03-09-073 03-10-014 03-10-037 04-03-045
Keywords: courses
Posted-Date: 15 Mar 2004 09:32:12 EST

I completely agree that an intro compiler course should span more than
one semester. Of course, to justify such a course, you'd probably
need to cover more than just compilers. But I think that's quite
plausible if the course integrated perhaps two or three interrelated
topics such as 1) programming languages, 2) compilers, 3) supporting
PL/CS theory, and 4) real-world O/S run time support.


Perhaps such a course could be built around a combination of
"Programming Language Pragmatics", by Scott, and a practical compiler
text like "Engineering a Compiler", by Cooper and Torczon, and then
supplemented with substantial background on PL and parsing theory,
with a dash of flavor added on O/S process support and libraries.


(Secretly, I really wonder how much of CS theory beyond that which is
relevant to compilers is really valuable to undergraduate students
anyway. Perhaps after combining the theory from such a year long
compiler course with more traditional theory courses like: 1) a
meaningful intro to programming (a la SICP), 2) discrete math, and 3)
algorithms, then CS theory would have been covered sufficiently well
to do away with the much hated and IMHO largely inapplicable undergrad
hurdle called "Intro to CS Theory". Just a thought. :-P)


Then as part of a year long compiler course, I'd love to delve into
some deeper intro-dependent topics, like surveying GCC's architectural
design trade offs (portability vs optimization), showing how it parses
using annotations (as in g++'s use of static and dynamic type info),
how it interacts with the O/S (e.g. glibc), perhaps exploring libm.a
math services, and so on. Students could then undertake several
larger projects, from building a novel toy parser to extending GCC
(e.g. in the direction of OpenMP, auto-parallelization, type
extensions, targeted optimizations, integrating run time profile info,
adding security or detecting insecurity, etc).


Maybe a every CS curriculum should require a senior-level year long
practicum like this. Instead of taking two or three more stovepiped
courses, the senior practicum could focus on one topic in greater
depth while emphasizing the practical: compilers, networking,
graphics, AI (e.g. building a useful system or a really smart game),
software engineering, etc. Each of these practicums would integrate
the preceding undergrad CS content, but do so thematically with more
depth than is possible in one semester.


AFAIK, the only college courses that span semesters are for freshman --
calculus and intro science -- which of course is backwards.


          Randy


Michael Ross wrote:
> I've long maintained that teaching compiler construction in a one semester
> course is doomed to fail. The kids simply can't learn fast enough. IMHO, the
> best way to teach compiler construction is to require a machine organization
> and architecture course, and an assembly language programming course as
> prerequisites. Then have compiler construction split across two semesters or
> 3 quarters, depending on your school. And instead of having the kids write
> their own from scratch, something they'll probably never do in their
> industrial careers, have them pick up something like gcc, study it, and
> modify it. Retarget it to a new machine. Add syntax. Go through and
> understand how it does error recovery, and try to improve on it. Yes, you
> can teach them to use flex and bison along the way, but this approach will
> be closer to real life, and over a year's time, working in teams, they'll
> learn enough about compilation to actually be useful. Just my opinion...


--
Randy Crawford http://www.ruf.rice.edu/~rand rand AT rice DOT edu



Post a followup to this message

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