Anyone interested in a Spirit for D?

Walter Bright newshound at digitalmars.com
Wed Oct 18 13:31:15 PDT 2006


Pragma wrote:
> Words of caution to follow:
> 
> FWIW, I looked into doing this years ago, and didn't get to far.  The 
> biggest hurdle, aside from the limitations of templates at the time, was 
> a lack of unary operators to override.  In particular, not being able to 
> override unary '*' and '!' caused some cosmetic problems.

I think the operator overloading aspect of Spirit is only a minor part 
of the implementation - in fact, just a pretty shell around it. It could 
all be done using functional notation.

> The only other major hangup I had was not having IFTI so I could 
> instantiate templates transparently.  This feature alone could close the 
> gap on most of Spirit's useage of C++ templates.  At a minimum, it means 
> that a D programmer could get very close to the cosmetic appeal of 
> Spirit (operator problems aside).

I think it would be worth looking at again. The C# version of it doesn't 
use operator overloading or even templates.


> Don't get me wrong: I'm not a nay-sayer here.  I think this is very 
> doable and worthwhile suggestion by Walter.  Folks should take it 
> seriously. But it will require some design compromises and changes from 
> the original - IMO, it'll probably require more of a re-write than a port.

I think it would be a complete rewrite.

The reason I'm interested in it for D is that:

1) it's a pretty cool library
2) it's one of Boost's most popular ones
3) it's been touted as a reason why D is no good and C++ roolz
4) it's popular enough to have been a driving force behind improvements 
in C++ compilers
5) it would surely improve D
6) and last, and most importantly, it's very useful



More information about the Digitalmars-d mailing list