Parsing: The Solved Problem That Isn't (2011)
1–10 of 90 posts
Re: Parsing: The Solved Problem That Isn't (2011)
#2Re: Parsing: The Solved Problem That Isn't (2011)
#3But this ignores all sorts of other steps you can take. Targeting multiple execution environments is an obvious step. Optimization is another. Trivial local optimizations like shifts over multiplications by 2 and fusing operations to take advantage of the machine that is executing it. Less trivial full program optimizations that can propagate constants across source files.
And preemptive execution is a huge consideration, of course. Very little code runs in a way that can't be interrupted for some other code to run in the meantime. To the point that we don't even think of what this implies anymore. Despite accumulators being a very basic execution unit on most every computer. (Though, I think I'm thankful that reentrancy is the norm nowadays in functions.)
Re: Parsing: The Solved Problem That Isn't (2011)
#4Have there been any notable innovations in parsing since this was written?
(I may be talking out of my ass here.)
Re: Parsing: The Solved Problem That Isn't (2011)
#5https://news.ycombinator.com/item?id=30414683
https://news.ycombinator.com/item?id=30414879
I spent a year or two working with PEGs, and ran into similar issues multiple times. Adding a new production could totally screw up seemingly unrelated parses that worked fine before.
As the author points out, Earley parsing with some disambiguation rules (production precedence, etc.) has been much less finicky/annoying to work with. It's also reasonably fast for small parses even with a dumb implementation. Would suggest for prototyping/settings when runtime ambiguity is not a showstopper, despite the remaining issues described in the article re: having a separate lexer.
Re: Parsing: The Solved Problem That Isn't (2011)
#6Have there been any notable innovations in parsing since this was written?
Re: Parsing: The Solved Problem That Isn't (2011)
#7My current view of what makes parsing so difficult is that people want to jump straight over a ton of intermediate things from parsing to execution. That is, we often know what we want to happen at the end. And we know what we are given. It is hoped that it is a trivially mechanical problem to go from one to the other. But this ignores all sorts of other steps you can take. Targeting multiple execution environments i…
Re: Parsing: The Solved Problem That Isn't (2011)
#8Have there been any notable innovations in parsing since this was written?
Re: Parsing: The Solved Problem That Isn't (2011)
#9Certain parser generators make life easier by supporting actions on parser/lexer rules. This is great and all, but it has the downside that the grammar you provide is no longer reusable. There's no way for others to import that grammar and provide custom actions for them.
I don't know. In my opinion parsing theory is already solved. Whether it's PEG, LL, LR, LALR, whatever. One of those is certainly good enough for the kind of data you're trying to parse. I think the biggest annoyance is the tooling.
Re: Parsing: The Solved Problem That Isn't (2011)
#10Have there been any notable innovations in parsing since this was written?
A somewhat breathless description of all of this is in the Marpa parser documentation:
https://jeffreykegler.github.io/Marpa-web-site/
In practice, I've found that computers are so fast, that with just the Joop Leo optimizations, 'naive' Earley parsing is Good Enough™: https://loup-vaillant.fr/tutorials/earley-parsing/