Re: why teach about compilers, was Java compiler courses

Steve Murray <stevem@ans.com.au>
Wed, 09 May 2007 12:24:00 GMT

          From comp.compilers

Related articles
[5 earlier articles]
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: Steve Murray <stevem@ans.com.au>
Newsgroups: comp.compilers
Date: Wed, 09 May 2007 12:24:00 GMT
Organization: Compilers Central
References: 07-04-074 07-04-098 07-04-120 07-04-149 07-04-153 07-04-155 07-05-005
Keywords: courses

Daniel C. Wang wrote:
> Robert A Duff wrote:
> {stuff deleted}
>> By the way, if I were teaching a compiler course, I would use OCaml or
>> Ada, neither of which is perfect. I would not use C or C++, and
>> probably not Java. As others have said, the goal is to teach general
>> principles about compilers, not to waste time fooling about with
>> low-level debugging.
>
> 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.


Yes, this all makes sense - there are always peripheral issues of
course, which tend to undermine generalisations. I'm currently putting
together a subject for senior undergraduate students on "Compiler
Technologies", but it's aimed at computer systems engineering and
software engineering students rather than being part of a classical
computer science programme. The context of a subject like this, and
current commercial and industrial trends suggest to me that for
engineering students, an appropriate compiler oriented subject would
utilise a reasonably conventional implementation language (C, C++, or
Java) and deal with an even more restricted set of source languages,
probably C alone.


Correct me if I'm wrong, but I guess most engineering graduates
working in this field would not in their day-to-day jobs be looking at
forms of expression in terms of developing new languages, but instead
being asked to concentrate their efforts on re-targetting (since new
processors are being churned out like sausages) and optimisation.


If this isn't all totally without base, then I'm going to put together
a subject where the students are delivered a compiler for a subset of
C (and implemented in C or Java) which is complete but emits
un-optimised code for an 8-bit or 16-bit microcontroller - actual
target yet to be determined. I'll provide a few lectures on the
already complete front end, but most of the subject will be centred on
code generation and optimisation. I'll essentially get them to
re-target the thing and add optimisations as well. Some of the more
adventurous students might want to add language features (which could
be accommodated) but that would be an optional extra as far as I'm
concerned. For engineering students, it's probably even preferable to
make time to look at the low-level relationships between compilers and
linkers (in the context of cross-development for embedded systems, for
example) in place of things like DFAs for lexers and a bunch of
parsing algorithms.


I guess there's enough in the field here to entertain everyone!


Steve
UTS



Post a followup to this message

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