News for hackers. Stuff that matters.
Re:Parsing: a timeline by jcranmer on Tuesday April 17, 2018 @03:10PM (#16861341)
The PEG aficionados basically believe that PEG is the magical solution to parsing problems: the grammar is by definition deterministic, so that's totally the solution to everything.

The problem is that the problem isn't so much that there can be two parse trees, it's that, as a language author, one needs to be aware of when two parse trees could come up. Precedence and dangling-else are well-known problems where declaring one path to be canonical is obviously the right answer, but most vexing parse is an example where the fact that an ambiguity existed in the first place is the problem, and declaring one to be the "right" way merely makes everyone complain about how it doesn't make sense.

When it comes to dealing with ambiguous grammars, PEG states that there's only one way to read a grammar, so you don't necessarily know that you're obscuring an ambiguity, unlike if you try to build an LR parser.

Re:Parsing: a timeline by mncharity on Tuesday April 17, 2018 @08:08PM (#16863497)
> PEG aficionados basically believe that PEG is the magical solution to parsing problems

Which can make for fun conversations...

PEG aficionado: [magical solution]

person2: [grammar limitations]

PEG aficionado: Yes, PEGs don't support legacy languages. [emphasis theirs]

person3: By legacy, you mean most all existing programming languages?

PEG aficionado: Yes. [straight face]