From: | torbenm@app-7.diku.dk (Torben =?iso-8859-1?Q?=C6gidius?= Mogensen) |
Newsgroups: | comp.compilers |
Date: | 7 May 2007 09:39:42 -0400 |
Organization: | Department of Computer Science, University of Copenhagen |
References: | 07-04-074 07-04-098 07-04-120 07-04-149 07-04-153 07-04-155 07-05-005 |
Keywords: | courses |
Posted-Date: | 07 May 2007 09:39:42 EDT |
"Daniel C. Wang" <danwang74@gmail.com> writes:
> Robert A Duff wrote:
>
> I would give the students a complete working implementation and ask
> them to modify it from parsing to code-gen to support new
> features. I've personally learned a lot more by modifying and reading
> good code than writing it from scratch.
This is exactly what I do in my compiler course at DIKU.
> In the past writing an interesting compiler was something you could
> accomplish in a semester. These days there's so much you should cover
> that there's no way to cover it all and have students produce a full
> compiler end-to-end without having them cursing your course.
Some students curse my mourse even if they do get a complete compiler
to modify. :-) And even if the modifications can be done in a few
hours if you know what to do (which they initially don't).
> I would not want students to write a compiler for a "modern" language
> that produced native code end-to-end, or compile a "legacy" language end
> to end. The former is too much work. The latter so dated as to be a
> disservice.
Indeed. My students get a small toy language to extend. Typically,
the initial language has only integers and they need to extend with
arrays or linked lists (no GC, though) and a few extra control
structures. I always make sure they need to add an extra attribute to
the translation functions to make the extensions, as using attributes
is one of the central points. They translate into almost-real machine
code (a subset of MIPS) which is run on an emulator.
Torben
Return to the
comp.compilers page.
Search the
comp.compilers archives again.