|Java compiler courses email@example.com (wooks) (2007-04-20)|
|Re: Java compiler courses firstname.lastname@example.org (Russell Shaw) (2007-04-23)|
|Re: Java compiler courses email@example.com (Andy Johnson) (2007-04-23)|
|Re: Java compiler courses firstname.lastname@example.org (glen herrmannsfeldt) (2007-04-23)|
|Re: Java compiler courses DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-04-23)|
|Re: Java compiler courses email@example.com (Chris Dollin) (2007-04-23)|
|Re: Java compiler courses firstname.lastname@example.org (Karsten Nyblad) (2007-04-25)|
|Re: Java compiler courses email@example.com (wooks) (2007-04-25)|
|Re: Java compiler courses DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-04-25)|
|Re: Java compiler courses firstname.lastname@example.org (2007-04-26)|
|Re: Java compiler courses email@example.com (Michael Klemm) (2007-04-26)|
|Re: Java compiler courses firstname.lastname@example.org (George Neuner) (2007-04-26)|
|Re: Java compiler courses email@example.com (glen herrmannsfeldt) (2007-04-26)|
|Re: Java compiler courses cfc@shell01.TheWorld.com (Chris F Clark) (2007-04-26)|
|[10 later articles]|
|Date:||25 Apr 2007 04:15:46 -0400|
|Posted-Date:||25 Apr 2007 04:15:46 EDT|
On Apr 23, 12:49 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu>
> 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)
> 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.
Return to the
Search the comp.compilers archives again.