Speed vs Readability (was: Re: [antlr-interest] syntactic predicates and exceptions)

Prashant Deva prashant.deva at gmail.com
Thu Oct 20 11:09:52 PDT 2005


I agree.
Readability should be the job of ides.
ANTLR itself should focus on going fast.

On 10/20/05, Chris Black <chris at lotuscat.com> wrote:
>
> I've been following this thread with interest and have decided to
> finally chime in (and change the subject header to something more
> indicative of the discussion). Some of my main reasons for using ANTLR
> rather than hand-coded parsers are speed and maintainability/readability
> of the GRAMMAR files (not the generated code). That the generated code
> is readable is nice, and certainly a bonus when it comes time to debug,
> but here are my thoughts on the matter:
> Go for speed of the core engine first. The code generator can always be
> adjusted to add readability later (by adding comments or generating
> better formatted/readable code).
>
> Chris
>
> Micheal J wrote:
>
> >>Nigel Sheridan-Smith wrote:
> >>
> >>
> >>>the readability of the code (and hence the ease of debugging and
> >>>tracing) will be reduced.
> >>>
> >>>
> >>>
> >>Don't underestimate this point. The readability is one of the main
> >>selling points of antlr. At least that is how I get away with
> >>using it
> >>in a yacc shop.
> >>
> >>
> >
> >Actually, the selling point is that it generates code that resembles what
> a
> >person might write while developing a hand-crafted parser. Getting rid of
> >exceptions for backtracking takes ANTLR closer to that ideal. ;-)
> >
> >Seriously, I have hand-crafted and also generated code that eschew the
> use
> >of exceptions for all but *truly* exceptional events and yes, the speed
> >boost is substantial and, I've had no problems come debug time. I don't
> >remember ever wishing it was more like ANTLR's default code output. I do
> >remember the satisfaction of seeing my language processors execute more
> >quickly than they would have otherwise ;-)
> >
> >Cheers,
> >
> >Micheal
> >
> >
> >
>
>


--
Prashant Deva
Creator, ANTLR Studio,www.antlrstudio.com <http://www.antlrstudio.com>
Founder, Placid Systems, www.placidsystems.com<http://www.placidsystems.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20051020/8ff72dc1/attachment.html


More information about the antlr-interest mailing list