Boost logo

Boost :

Subject: Re: [boost] [msm] Review
From: David Bergman (David.Bergman_at_[hidden])
Date: 2009-12-03 20:18:00

On Dec 3, 2009, at 6:27 PM, Andreas Huber wrote:

>> We do not have this much overlap in any other library w.r.t.
>> features and interface.
> What about Regex and Xpressive? I know neither of these libraries well, but doesn't Xpressive offer what Regex offers and more?

Actually, I meant to include the triplet Regex, Spirit and Xpressive in my discussion about the closest case to the Statechart/MSM situation.

Since Xpressive - conceptually - solves the problems of both Regex and Spirit, one could argue that it would be the only one needed in this triplet. BUT, the interface to regular expressions (and regular languages) is quite different between Xpressive and Regex and the latter conforms more to the Perl+GNU-style API's of dealing with regular expressions.

If I were king of the world (...), I would standardize on Xpressive and deprecate both Spirit and Regex, *with regards to* interface and features (and not implementation.) Regex is obviously easier to wrap around a proven and efficient implementation such as PCRE, and is easier to inject in C++0x...

It is no coincidence that Xpressive came after Spirit and Regex.

In fact, I have had to explain - and justify - this triplet to new Boosters in my teams. But, we here have different interfaces and different problems (or languages to parse): regular vs context-free vs both. For less DSLish developers, Regex is the clear choice for regular expressions. But, I have managed to convert a few people to become DSL:ers, and am planning to open their eyes to Proto; once they get hooked on DSL, they love Spirit and Xpressive.


Boost list run by bdawes at, gregod at, cpdaniel at, john at