[Python-ideas] Built-in parsing library

Guido van Rossum guido at python.org
Mon Apr 1 01:14:41 EDT 2019


We do have a parser generator in the standard library:
https://github.com/python/cpython/tree/master/Lib/lib2to3/pgen2

On Sun, Mar 31, 2019 at 9:17 PM Nam Nguyen <bitsink at gmail.com> wrote:

> On Sun, Mar 31, 2019 at 12:13 PM David Mertz <mertz at gnosis.cx> wrote:
>
>> I just found this nice summary. It's not complete, but it looks well
>> written. https://tomassetti.me/parsing-in-python/
>>
>> On Sun, Mar 31, 2019, 3:09 PM David Mertz <mertz at gnosis.cx> wrote:
>>
>>> There are about a half dozen widely used parsing libraries for Python.
>>> Each one of them takes a dramatically different approach to the defining a
>>> grammar. Each one has been debugged for over a decade.
>>>
>>> While I can imagine proposing one for inclusion in the standard library,
>>> you'd have to choose one (or write a new one) and explain why that one is
>>> better for everyone (or at least a better starting point) than all the
>>> others are.
>>>
>>
> I'm not at that stage, yet. By the way, it still is not clear to me if you
> think having one in the stdlib is desirable.
>
>
>> You're also have to explain why it needs to be in the standard library
>>> rather than installed by 'pip install someparser'.
>>>
>>
> Installing a package out of stdlib does not solve the problem that
> motivated this thread. The libraries included in the stdlib can't use those
> parsers.
>
> Cheers,
> Nam
>
>
>>
>>> On Sat, Mar 30, 2019, 1:58 PM Nam Nguyen <bitsink at gmail.com> wrote:
>>>
>>>> Hello list,
>>>>
>>>> What do you think of a universal parsing library in the stdlib mainly
>>>> for use by other libraries in the stdlib?
>>>>
>>>> Through out the years we have had many issues with protocol parsing.
>>>> Some have even introduced security bugs. The main cause of these issues is
>>>> the use of simple regular expressions.
>>>>
>>>> Having a universal parsing library in the stdlib would help cut down
>>>> these issues. Such a library should be minimal yet encompassing, and whole
>>>> parse trees should be entirely expressible in code. I am thinking of
>>>> combinatoric parsing as the main candidate that fits this bill.
>>>>
>>>> What do you say?
>>>>
>>>> Thanks!
>>>> Nam
>>>> _______________________________________________
>>>> Python-ideas mailing list
>>>> Python-ideas at python.org
>>>> https://mail.python.org/mailman/listinfo/python-ideas
>>>> Code of Conduct: http://python.org/psf/codeofconduct/
>>>>
>>> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190331/05eedc3b/attachment.html>


More information about the Python-ideas mailing list