Greg Ewing wrote:
On 3/04/20 7:10 am, Guido van Rossum wrote:
Since last fall's core sprint in London, Pablo Galindo Salgado, Lysandros Nikolaou and myself have been working on a new parser for CPython. We are now far enough along that we present a PEP we've written: https://www.python.org/dev/peps/pep-0617/ Was any consideration given to other types of parser, such
as LR or LALR? LR parsers handle left recursion naturally, and don't suffer from any of the drawbacks mentioned in the PEP such as taking exponential time or requiring all the source to be loaded into memory. I think there needs to be a section in the PEP justifying the choice of PEG over the alternatives.
I think "needs" is a bit strong. It would be nice, though. Regardless, as long as this is a net improvement over the status quo I don't see this being rejected on the grounds that an LR or LALR parser would be better since we have a working PEG parser today. :)