Re: Java compiler courses

wooks <wookiz@hotmail.com>
25 Apr 2007 04:15:46 -0400

          From comp.compilers

Related articles
Java compiler courses wookiz@hotmail.com (wooks) (2007-04-20)
Re: Java compiler courses rjshaw@netspace.net.au (Russell Shaw) (2007-04-23)
Re: Java compiler courses ajohnson@mathworks.com (Andy Johnson) (2007-04-23)
Re: Java compiler courses gah@ugcs.caltech.edu (glen herrmannsfeldt) (2007-04-23)
Re: Java compiler courses DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-04-23)
Re: Java compiler courses chris.dollin@hp.com (Chris Dollin) (2007-04-23)
Re: Java compiler courses 148f3wg02@sneakemail.com (Karsten Nyblad) (2007-04-25)
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)
[10 later articles]
| List of all articles for this month |

From: wooks <wookiz@hotmail.com>
Newsgroups: comp.compilers
Date: 25 Apr 2007 04:15:46 -0400
Organization: Compilers Central
References: 07-04-07407-04-082
Keywords: Java, courses
Posted-Date: 25 Apr 2007 04:15:46 EDT

On Apr 23, 12:49 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu>
wrote:
> wooks wrote:
> > 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).
>
> Well, first, Java compilers are likely to be written in Java,
> following the tradition of writing compilers in the language
> that they compile.


But that presupposes the course is aiming to build a compiler for Java
- which may be the case - and then may not. If you are on a 10 week
course being asked to design a compiler for an OO subset is like
being asked to run before you've learnt to walk.


> > Why would anybody want to write a compiler in Java (unless it's the
> > only language they know).
>
> Java has much better support for string handling than C does. It is
> likely slower, but that isn't always a limitation for a compiler.
> Computers are now fast enough, and with JIT java is usually
> pretty fast. Debugging mistakes in string handling in C,
> such as overrunning the end of a string, is not easy. Java
> checks string bounds, simplifying debugging.


Those are all the sort of arguments one could make for writing
compilers in ..... (insert your favourite higher level (than C)
language).


> Now, why would anyone want to write a compiler in C?


For the reasons I stated in my post.


1. Better documented C based tools (lex/flex, yacc/bison). Hence why
instructors on Java courses keep referring students to the GNU
documentation in preference to CUP.


2. More books to choose from so that you can find the right one for
you (and there's a better chance that you can find it in the library)
which is important. There are only 3 Java books - Appel, Watt and the
one by Patrick Terry (not available via Amazon.com and a hefty 46GBP
2nd hand in the UK).


3. Don't need to get to grips with the non intuitive Visitor Pattern -
if you're on a course thats taught over 10 weeks there's enough new
concepts to worry about in that short period of time.


PS - C is not my language of choice for programming in general - it
just seems that it is best suited for this application.


Post a followup to this message

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