David Halter <davidhalte...@gmail.com> added the comment:

@gvanrossum

> Does parso have to be pure Python? If not, we could generate C code like we 
> do for CPython's parser. 

I would rather write the parser either in C or Rust. So no, parso does not need 
to be pure Python.

> Now, that doesn't work for incremental parsing, but I did an alternative 
> implementation that uses a stack machine, also in C, that's only 2x slower 
> than the PEG parser. Maybe that could be adapted to incremental parsing 
> (because it's a stack machine). Error recovery is still a research project 
> (at least for me -- I'm actually reading papers :-).

Makes sense! I was also thinking about GLL parsing. Obviously GLL does not 
cover all cases where PEG could potentially work, but I doubt that Python ever 
moves to a place where GLL would not be sufficient.

I'm also doing a bit of research on Rust parsers and trying to find a solution 
for my parsing needs in the future. (I'd rather have a Rust parser than a C 
one, because I like the language better and both should still work in Python).

Please let me know if you're making a lot of progress with PEG parsers and 
error recovery/incremental parsing. I'm definitely interested in copying an 
approach if it works :).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40360>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to