Boost logo

Boost :

Subject: Re: [boost] [Review] XInt Review
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2011-03-09 14:46:17


> Granted, proto has a number of very nice features. The question is, would xint benefit from them? Does this library require transforms and or multiple passes? I certainly hope not. The default operator precidence happens to the one we want in this case (as far as I understand) so what is the point of defining a grammar for operator expressions to achieve what would happen by default without one?
>
> Please correct me if I am wrong.
>
>
For me the inetrest if on function composition optimization.

Let's say you have the ln and gamma function operating on your type
(silly example but take any too function who ends up with a large gap of
bits for representing the reuslt).

Calling ln(gamma(x)) in a regular library will give you a quite large
value (and reuqire slotsa bits) and you'll shrink it through the log,
havign allcoated new bits for no real gain.

Now make it proto based and have a ruel matching tree of (ln -- gamma --
x) and transform it into gammaln(x) with a better, less bits intensive
version.
Less bits allocated, more pecise result.

This is some example and I think a substantial amount cna be found. Now,
make it properly so you can add special case liek that outside and you
have an extensible optimization point.


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