|
Boost : |
From: Eric Niebler (eric_at_[hidden])
Date: 2005-09-14 02:00:51
Daryle Walker wrote:
> On 9/13/05 10:56 AM, "Eric Niebler" <eric_at_[hidden]> wrote:
>
>>It's true that there is functional overlap between Regex and xpressive,
>>but xpressive takes a much broader view of pattern matching. And just
>>because one piece of this puzzle has been proposed for standardization
>>doesn't mean that all innovation in this problem space must cease.
>
>
> If xpressive gets accepted...
>
> ..could we factor stuff so common capabilities get to be in one set of
> code? (In other words, is xpressive is a super-set of Boost.Regex, and if
> so, can we change the implementation of Boost.Regex to use xpressive? What
> about any commonalities between these libraries and Spirit. Maybe we could
> have a grand unification of these three libraries some day, if appropriate.
> Of course, we could start a Regex and Spirit factoring now.)
xpressive is more like Spirit than Regex, and Joel and I have spent much
time talking about unification possibilities. Our current thinking is
that in the future, Spirit and xpressive will share a common core. In
fact, I have already begun factoring out and generalizing large chunks
of xpressive's meta-programming for reuse as a general expression
template domain-specific embeded language compiler construction toolset
(see boost/xpressive/detail/proto). In addition, xpressive already
reuses Fusion, which is part of Spirit.
Unification with Boost.Regex would be less straightforward. Look over my
reply to Thomas Witt about the design of xpressive's basic_regex<> type:
http://article.gmane.org/gmane.comp.lib.boost.devel/130973
xpressive's design goals led to a different interface and a different
internal representation for the regex type. The interface chosen by
Boost.Regex places some requirements on the implementation -- namely,
that the compiled form of a regex much be iterator-neutral. xpressive's
implementation is a poor fit for the Boost.Regex interface. IMO, it's
best to leave Boost.Regex alone. Its implementation is a far better fit
for its interface than xpressive would be.
-- 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