Subject: Re: [boost] Determining interest: C++11 parser generator library
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-11-14 19:17:53
On 11/15/2011 1:08 AM, Gene Bushuyev wrote:
> "John Bytheway" <jbytheway+boost_at_[hidden]> wrote in message
>> On 13/11/11 23:39, Gene Bushuyev wrote:
>>> Sorry if it turns out to be a duplicate, it looks my original post was
>>> lost in cyberspace, so I'm re-posting this request.
>>> I'm trying to determine if there is a sufficient interest for including
>>> AXE C++11 recursive descent parser generator library in Boost. The
>>> zipped sources and documentation are here:
>> People are more likely to investigate if you can provide a link to the
>> documentation online somewhere, so they don't have to download and
>> extract a zip file.
>> It would also be useful to explain briefly how it compares with
>> John Bytheway
> It's true there is a significant overlap with Spirit. It's also true there is more than
> one way to do the parsing, so some people will be more comfortable with Spirit, and I have
> reasons to believe some people will be more comfortable with AXE. There are differences,
> importance of which depends on personal perspective and needs. I tried to summarize below
> what I would consider advantages of AXE:
> * it's a much smaller header only library: 15 files, 126 KB total
> * it has no dependencies on other libraries apart from the Standard library
> * it uses only standard facilities, so theoretically it should work with any C++11
> compiler without any modifications
> * compilation times are much shorter than Spirit
> * the syntax is less cryptic than Spirit, so it's easier to remember, write, debug, and
> read parsers written in AXE (this is, of course, subjective)
> * in my limited comparison, parsers written in AXE take fewer lines of code to write, and
> development times are shorter
> * AXE requires C++11 compiler, current status of compiler support is unknown
> * It's been released recently, thus there is limited experience working with it
When Spirit debuted, it was a 7 header file. If your library gets more mature,
the added complexity will be necessary. Your main advantage is simplicity.
I can't argue with that. However, it is also your big disadvantage. Here are
some more important points you missed in your Disadvantages section:
* It does not have unicode support.
* It does not have attributes and AST support. It is a purely
transduction parser like Spirit 1.0. So in every step,
you have to convert an iterator range to an attribute manually.
* It does not have support for polymorphic semantic actions
(you know that c++ lambda is monomorphic, right?).
* It does not have reusable grammars
* No symbol tables
* No character sets
* No separation of grammar construction and parsing. Your examples have
a big overhead: they build the parser every time you parse.
* The syntax is *more* cryptic than Spirit (this is, of course, subjective :-)
Just to name a few.
-- Joel de Guzman http://www.boostpro.com http://boost-spirit.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk