Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2008-03-01 16:14:54


Tom Brinkman wrote:
> Proto is the new backend for boost::spirit, boost::xpressive and the
> re-write of boost::phoenix, this is indeed an important library.
> It would seem that "Proto" already has the support of all of the top boost
> developers.
>
> 1) I wonder if you could give us a little bit of history, what motivated
> this library?

Good question. In Proto's docs, there is a History appendix:
http://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost_proto/appendices/history.html

There you'll find links to extensive discussions on the spirit
developers list that informed much of Proto's design.

In particular, the initial motivation for Proto was to simplify
xpressive's metaprogramming, which after several year's work, had become
brittle. Even with MPL, the job of implementing a domain-specific
embedded language using expression templates required a large amount of
very low-level code that is hard to maintain. With Proto, a DSEL is
described and implemented at the level of grammars and semantic actions
rather than low-level template hackery.

> 2) What were the defincies in previous design of boost::spirit. Why does
> spirit need a new backend?

The decision to reimplement Spirit was made before the decision to adopt
Proto and was motivated both by efficiency and architectural concerns,
IIUC, but Joel and Hartmut are better qualified to answer that.

Very early on in the reimplementation effort, I convinced Joel and
Hartmut to use Proto. The killer argument at the time was that it allows
Qi and Karma share DSEL primitives (see
http://osdir.com/ml/parsers.spirit.devel/2006-04/msg00035.html). Since
then, many more of Proto's features have found use in Spirit-2. In
particular, the job of transforming an expression template into a Qi
parser or a Karma generator is handled by Proto transforms.

> Learning to use boost:spirit is about a six month learing curve, but well
> worth it. For me, it was my
> introduction to functional programming. I'm excited to see what else is
> possible.

Spirit-2 is cool tech. I'll let Joel and Hartmut speak to that.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk