Re: why teach about compilers, was Java compiler courses

torbenm@app-7.diku.dk (Torben =?iso-8859-1?Q?=C6gidius?= Mogensen)
7 May 2007 09:54:08 -0400

          From comp.compilers

Related articles
[4 earlier articles]
Re: why teach about compilers, was Java compiler courses gneuner2@comcast.net (George Neuner) (2007-04-29)
Re: why teach about compilers, was Java compiler courses bobduff@shell01.TheWorld.com (Robert A Duff) (2007-04-29)
Re: why teach about compilers, was Java compiler courses danwang74@gmail.com (Daniel C. Wang) (2007-05-04)
Re: why teach about compilers, was Java compiler courses cdsmith@twu.net (Chris Smith) (2007-05-04)
Re: why teach about compilers, was Java compiler courses gneuner2@comcast.net (George Neuner) (2007-05-04)
Re: why teach about compilers, was Java compiler courses torbenm@app-7.diku.dk (2007-05-07)
Re: why teach about compilers, was Java compiler courses torbenm@app-7.diku.dk (2007-05-07)
Re: why teach about compilers, was Java compiler courses stevem@ans.com.au (Steve Murray) (2007-05-09)
Re: why teach about compilers, was Java compiler courses danwang74@gmail.com (Daniel C. Wang) (2007-05-10)
| List of all articles for this month |
From: torbenm@app-7.diku.dk (Torben =?iso-8859-1?Q?=C6gidius?= Mogensen)
Newsgroups: comp.compilers
Date: 7 May 2007 09:54:08 -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-007
Keywords: courses
Posted-Date: 07 May 2007 09:54:08 EDT

Chris Smith <cdsmith@twu.net> writes:




> What I'm wondering is: assuming that compilers is being taught to
> students in their third or fourth year of a CS degree program, why
> would one pick a language? Wouldn't one simply give them a project
> and let them decide how to do it?


That is fine is you ask the students to start from scratch, but if you
want them to use tools for lexing, parsing and register allocation,
you have to make sure these exist for the languages used. Lexing and
parsing is probably not too bad, but you can rarely download workable
register allocators for a variety of languages. I suppose an
exception would be if you use Andrew Appel's book, where there are
implementations of the Tiger compiler (including registr allocator)
for ML, C and Java.


And if the exercise is to extend an existing compiler (that the
lecturer has prepared), you more or less have to stick with that
language.


> I took a compilers course that didn't specify a language. I wrote a
> compiler in Haskell; others used C, Java, C#, VB, or whatever. I seem
> to recall that one poor soul decided to use Perl, but he made his own
> choice and he got things done in the end. The course I took also
> banned third-party code generator tools; I guess if you needed to
> teach some specific lex/yacc-ish products, that would be a reason to
> pick a language. If you teach the algorithms, though, they are
> largely independent of language.


Indeed. I think an interesting exercise would be to require the
students to implement the same compiler in two very different
languages (e.g., C++ and SML), so they can separate concepts from
implementation. But such an approach would probably make students
unhappy. :-)


Torben


Post a followup to this message

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