[antlr-interest] Complementing ANTLR with parboiled

Ron Burk ronburk at gmail.com
Thu Mar 4 12:05:41 PST 2010


> PS: Of course any feedback

OK, I was bemused by your "motivation" page. The motive is built
around the desire to create domain-specific languages with Java.
But then, the first disadvantage you claim for existing parser generators
is this:

  Special, non-java grammar syntax in separate project files

Um, that's because parser generators *are* domain-specific
languages!  So, you don't like special, non-java syntaxes,
but your goal is to create a tool that lets people create special,
non-java syntaxes. :-)

But seriously, much of the other motivation points also suffer
the same self-contradictory problem vis a vis the basic nature
of a domain-specific language. OTOH, this point deserves special
note:

    More complicated design and maintenance through divided
    parsing process in lexing (token generation) and token
    parsing phases

The division of labor between lexing and parsing is more than
half a century old, and it was arrived at (and survived) because
it does exactly the opposite of what you say: it makes the
code more modular and easier to maintain. When you try to
pack the two together for any non-trivial language, you
inevitably see the hacks multiply (e.g., something as trivial
as white space becomes some kind of "special case").

Finally, as we live in an age where CPU speed has peaked
and even begun to decline, there is increasing pressure to
parallelize code to take advantage of the only remaining
practical advantage of Moore's law -- increasing numbers
of CPUs. For a language processor, one of the few neat
and modular divisions of labor that can easily be put
in parallel is the division between lexing and parsing.
Often, efficiency doesn't matter for parsing, but since
you list ANTLR's footprint as a disadvantage, it becomes
contradictory to claim that combining lexing and parsing
so they can't be parallelized is an unvarnished advantage.

None of this is by way of criticism of the project, which
I find interesting reading (thanks for the pointer!).


More information about the antlr-interest mailing list