Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; 'syntax': 0.04; 'third-party': 0.04; 'importing': 0.05; 'subject:Python': 0.06; 'parser': 0.07; 'plenty': 0.07; 'subject:PEP': 0.07; 'though:': 0.07; 'welcome.': 0.07; 'already.': 0.09; 'builtin': 0.09; 'classes.': 0.09; 'e.g.,': 0.09; 'generators': 0.09; 'parsing': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'seemed': 0.09; 'subject:GSoC': 0.09; 'subject:module': 0.09; 'python': 0.11; 'jan': 0.12; 'mostly': 0.14; 'idea:': 0.16; 'programing': 0.16; 'pythonic': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'relates': 0.16; 'subject:generator': 0.16; 'subject:parser': 0.16; 'task.': 0.16; 'tends': 0.16; 'wiki,': 0.16; 'student': 0.16; 'language': 0.16; 'wrote:': 0.18; 'library': 0.18; 'looked': 0.18; 'all,': 0.19; 'bit': 0.19; 'module': 0.19; 'developer,': 0.19; 'everyone,': 0.19; 'written': 0.21; 'seems': 0.21; 'input': 0.22; 'header:User-Agent:1': 0.23; 'integrate': 0.24; 'module,': 0.24; "i've": 0.25; 'developers': 0.25; '(see': 0.26; 'second': 0.26; 'subject:/': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'point': 0.28; '(this': 0.29; '[1]': 0.29; "doesn't": 0.30; "i'm": 0.30; 'serve': 0.31; 'towards': 0.31; 'integrating': 0.31; 'large.': 0.31; 'libraries': 0.31; 'raised': 0.31; 'waters': 0.31; 'probably': 0.32; 'figure': 0.32; 'run': 0.32; 'another': 0.32; 'worked': 0.33; 'community': 0.33; 'running': 0.33; 'core': 0.34; 'problem': 0.35; 'something': 0.35; 'one,': 0.35; "who's": 0.35; 'test': 0.35; 'but': 0.35; 'building': 0.35; 'there': 0.35; 'library.': 0.36; 'module.': 0.36; "didn't": 0.36; 'subject:?': 0.36; 'should': 0.36; 'so,': 0.37; 'too': 0.37; 'turn': 0.37; 'list': 0.37; 'project': 0.37; 'list.': 0.37; 'feedback': 0.38; 'tasks': 0.38; 'needed': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'pm,': 0.38; 'rather': 0.38; 'embedded': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'extended': 0.61; 'new': 0.61; 'received:173': 0.61; 'providing': 0.61; 'first': 0.61; 'kind': 0.63; 'pick': 0.64; 'more': 0.64; 'different': 0.65; 'specialized': 0.65; 'contact': 0.67; 'received:fios.verizon.net': 0.84; 'route': 0.84; "they'd": 0.84; 'imagine': 0.93; 'tied': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: PEP/GSoC idea: built-in parser generator module for Python? Date: Fri, 14 Mar 2014 15:48:23 -0400 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-254-207.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 65 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1394826538 news.xs4all.nl 2870 [2001:888:2000:d::a6]:35706 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68362 On 3/14/2014 2:51 PM, Peter Mawhorter wrote: > First of all, hi everyone, I'm new to this list. Welcome. > I'm a grad student who's worked on and off with Python on various > projects for 8ish years now. I recently wanted to construct a parser > for another programing language in Python and was dissapointed that > Python doesn't have a built-in module for building parsers, which > seems like a common-enough task. There are plenty of different > 3rd-party parsing libraries available, specialized in lots of > different ways (see e.g., [1]). I happened to pick one that seemed > suitable for my needs but didn't turn out to support the recursive > structures that I needed to parse. Rather than pick a different one I > just built my own parser generator module, and used that to build my > parser: problem solved. > > It would have been much nicer if there were a fully-featured builtin > parser generator module in Python, however, and the purpose of this > email is to test the waters a bit: is this something that other people > in the Python community would be interested in? I imagine the route to > providing a built-in parser generator module would be to first canvass > the community to figure out what third-party libraries they use, and > then contact the developers of some of the top libraries to see if > they'd be happy integrating as a built-in module. At that point > someone would need to work to integrate the chosen third-party library > as a built-in module (ideally with its developers). I think the idea has been raised before, but I am not sure which list (this one, pydev, or python-ideas). My first reaction, as a core developer, is that the stdlib is, if anything, too large. It is already not as well-maintained as we would like. My second is that parser generation is an application, not a library. A parser generator is used by running it with an input specification, not by importing it and using specific functions and classes. > From what I've looked at PyParsing and PLY seem to be standout parser > generators for Python, PyParsing has a bit more Pythonic syntax from > what I've seen. One important issue would be speed though: an > implementation mostly written in C for low-level parsing tasks would > probably be much preferrable to one written in pure Python, since a > builtin module should be geared towards efficiency, but I don't > actually know exactly how that would work (I've both extended and > embedded Python with/in C before, but I'm not sure how that kind of > project relates to writing a built-in module in C). Something written in Python can be run with any implementation of Python. Something written in C tends to be tied to CPython, > Sorry if this is a bit rambly, but I'm interested in feedback from the > community on this idea: is a builtin parser generator module > desirable? If so, would integrating PyParsing as a builtin module be a > good solution? What 3rd-party parsing module do you think would serve > best for this purpose? > [1] http://nedbatchelder.com/text/python-parsers.html Perhaps something like this should be in the wiki, if not already. -- Terry Jan Reedy