This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author davidhalter
Recipients BTaskaya, Peter Ludemann, carljm, corona10, davidhalter, eric.snow, gregory.p.smith, gvanrossum, hroncok
Date 2020-07-26.22:42:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1595803321.2.0.712601904142.issue40360@roundup.psfhosted.org>
In-reply-to
Content
Parso's incremental parser is a terrible idea. It also works and is pretty fast, but the design is pretty terrible (it took me a lot of fuzzing to make sure that it works decently well).

The basic problem is that it's reusing nodes in a mutable way. If I were to redo it, I would probably choose a similar approach to Roslyn's red/green trees. It's probably also possible to use these approaches in Python, but they might be quite a bit slower than what I'm using (because recreating nodes can be quite expensive).

I imagine that one of the biggest issues with parsing PEG in parso would be to do it with error recovery AND incremental parsing. That combination can be quite annoying, but it's definitely still possible.

I'm not really sure about the future of parso with PEG. I'm definitely going to have to find a way to parse 3.10+ (so Jedi is going to keep working), however I feel like that it's hard to achieve a fast parser in pure Python. Parso is like 20% faster, but still more than ten times slower than the CPython parser...
History
Date User Action Args
2020-07-26 22:42:01davidhaltersetrecipients: + davidhalter, gvanrossum, gregory.p.smith, carljm, eric.snow, hroncok, corona10, BTaskaya, Peter Ludemann
2020-07-26 22:42:01davidhaltersetmessageid: <1595803321.2.0.712601904142.issue40360@roundup.psfhosted.org>
2020-07-26 22:42:01davidhalterlinkissue40360 messages
2020-07-26 22:42:01davidhaltercreate