[antlr-interest] stuff I don't like about ANTLR 2.x

Ric Klaren klaren at cs.utwente.nl
Mon Mar 15 04:18:18 PST 2004


Hi,

On Sun, Mar 14, 2004 at 12:39:13PM -0800, Terence Parr wrote:
> The issue could be that C++ / C header files are a poor mechanism in
> general for factoring stuff due to very coarse granularity of
> dependencies.  Can you suggest some factoring tips?

Well that's not the issue ;) It's more that it's a 1-on-1 java port and in
java the only hammer java people have to solve something is OO. While in
C++ stuff might have been solved in another way (antlr's support lib is
just waiting for some template stuff)

There's a lot of algorithms wrapped in classes like ASTFactory that
actually would be more fit for a template implementation (dupTree and
friends) Also interface stuff does not port as nicely to C++ in all
situations. The reference counter used in the runtime is then another way
to make things work less than ideal. The C++ runtime also has a some
redundant class hierarchies. AST<-BaseAST<-CommonAST baseast is redundant
since no antlr code will work with less than common AST functionality.

<ANTI-JAVA-BIGOT-SECTION>
> [Side note from an anti-C++ bigot: I can't believe people don't
> complain about the complete lack of portability of C++.]

We complain more about compiler compliance ;)

> Never once have I heard people say that the Java code won't compile

Ah it just runs out of memory if I take the wrong VM.. or does other funny
random things ;)

> It is truly astounding that nearly 20 years after the first lecture I heard
> on C++, we still don't have a portable language.

My guess is that C++ code runs on more platforms than java ;) Might I make
a honourable mention of java's sibling (developer wise) TCL/TK which is
seriously more portable than java ;)

Not to mention the fact that's it's so easy to catch a nullpointer
exception in java. So that the below-average developer can just add a catch
somewhere to work around his incompetence, leaving the offending program in
some inconsistent state with all the 'funny' side effects. Of course in
windows you'll never (well almost) see the exception spam this creates.
(yes I wasted too much time tracking down a problem in a program that did
this kind off stuff... Ye gods I like core dumps! (it took java to make me
say that ;) ))

To sum up C++ is not ideal but java is far from the holy grail it was
heralded to be ;) Incompetents can still make holes in feet all over the
planet (their own as well as in the feet of the poor sobs that have to use
their products) I kinda prefer working around the trouble with C++ but
everyone their own poison ;)

</ANTI-JAVA-BIGOT-SECTION>

(sorry for the XML Ter ;) )

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
  "Good judgement comes from experience.
     Experience comes from bad judgement." --- Unknown



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list