Re: why teach about compilers, was Java compiler 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

.



Relevant Pages

  • Re: Java compiler courses
    ... students are taught Java and not C). ... Why would anybody want to write a compiler in Java (unless it's the ...
    (comp.compilers)
  • Re: Java compiler courses
    ... Why would anybody want to teach a compiler course in Java when it ... Why would anybody want to write a compiler in Java (unless it's the ... Most of the students on are never going to write a compiler. ... Who cares what language the compiler is written in in that case? ...
    (comp.compilers)
  • Re: Java compiler courses
    ... Who cares what language the compiler is written in in ... exceptions I think the only people who really study compiler ... students later in will use their knowledge in projects using C. ... programming skills are an integral part of a CS ...
    (comp.compilers)
  • Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
    ... What matters is that Lisp teaches students to use ... recursion, because they have to. ... Java does NOT teach students to use ... pointers and recursion, she'll be able to understand anything, and get ...
    (comp.programming)
  • Re: Delphi 8 vs Visual Studio
    ... They chose the languages from the teaching point (a Lisp ... You can teach many things with Java and C#, ... > Ask the students which language/tools they would want to learn. ...
    (borland.public.delphi.non-technical)