Re: Java compiler courses

Chris F Clark <cfc@shell01.TheWorld.com>
26 Apr 2007 09:44:51 -0400

          From comp.compilers

Related articles
[7 earlier articles]
Re: Java compiler courses wookiz@hotmail.com (wooks) (2007-04-25)
Re: Java compiler courses DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-04-25)
Re: Java compiler courses torbenm@app-7.diku.dk (2007-04-26)
Re: Java compiler courses usenet@gmx.info (Michael Klemm) (2007-04-26)
Re: Java compiler courses gneuner2@comcast.net (George Neuner) (2007-04-26)
Re: Java compiler courses gah@ugcs.caltech.edu (glen herrmannsfeldt) (2007-04-26)
Re: Java compiler courses cfc@shell01.TheWorld.com (Chris F Clark) (2007-04-26)
Re: Java compiler courses DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-04-27)
Re: Java compiler courses DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-04-27)
Re: Java compiler courses gneuner2@comcast.net (George Neuner) (2007-04-28)
Re: Java compiler courses DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-04-29)
Re: Java compiler courses gah@ugcs.caltech.edu (glen herrmannsfeldt) (2007-04-29)
Re: Java compiler courses marcov@stack.nl (Marco van de Voort) (2007-05-10)
[4 later articles]
| List of all articles for this month |
From: Chris F Clark <cfc@shell01.TheWorld.com>
Newsgroups: comp.compilers
Date: 26 Apr 2007 09:44:51 -0400
Organization: The World Public Access UNIX, Brookline, MA
References: 07-04-074
Keywords: Java, courses
Posted-Date: 26 Apr 2007 09:44:51 EDT

wooks <wookiz@hotmail.com> writes:


> Why do they exist.
>
> Why would anybody want to teach a compiler course in Java when it
> seems that there are more and better resources (books, tools)
> supporting a compilers course based on C (aside from the obvious -
> students are taught Java and not C).
>
> Why would anybody want to write a compiler in Java (unless it's the
> only language they know).


First, of all, you answered your question with the obvious answer.
Java is the main teaching language in many universities. That is the
primary reason there are Java compiler courses.


However, let's answer your second question, why not teach a compiler
course in C given the wealth of books and tools supporting such a
course? And, the related question, why write a compiler in Java (and
not in C)?


Next, I want to preface this with the fact that I have been a compiler
tool writer since 1987, and a professional compiler writer since 1978,
and most of the compilers I have written have been in lanugages at the
C level (e.g. C, Pascal, PL1/G, Jovial) and that the compiler tool I
wrote was originally targeted at C and C++.


I will candidly say that I wouldn't write a compiler in C (and only
grudgingly in C++) today if given the choice. I wouldn't feel
significantly inconvenienced if I was asked to write a compiler in
Java or C#.


Now, to your resource issue. Most of the compiler books aren't that
good, and almost any compiler book that would teach one to write a
compiler in a specific language (and have that language matter) is
more than likely not good. I qualified that statement, because the
Appel compiler book was originally designed around ML as the language
and that made it better even after it has been transliterated to other
languages. (To me that suggests something about functional
programming, but that may just be my bias.)


The same thing is roughly true about tools. There are some good
tools. There are also some venerable tools and long used tools. They
are not the same. Now, I have a strong bias here (and I will
apologize for letting it show), but if I thought lex/flex and
yacc/bison were good tools and well-documented, there wouldn't be a
Yacc++ (and its roughly 1k pages of documentation). And, honestly, I
wouldn't be satisfied with Yacc++ nor its documentation either.


However, all of that said, at the level one is trying to get in the
first compiler course, none of the above matters. I think one can get
the fundamentals of compiler construction across using an ok book, and
an ok tool. I think one can write a pretty good compiler-ish program
in a Java-like language after taking one of said courses.


Just my opinions,
-Chris


*****************************************************************************
Chris Clark Internet : compres@world.std.com
Compiler Resources, Inc. Web Site : http://world.std.com/~compres
23 Bailey Rd voice : (508) 435-5016
Berlin, MA 01503 USA fax : (978) 838-0263 (24 hours)


Post a followup to this message

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