Boost logo

Boost :

Subject: Re: [boost] [yap] Re-announcing Yap
From: Oswin Krause (Oswin.Krause_at_[hidden])
Date: 2017-03-31 07:20:47


On 2017-03-31 03:02, Edward Diener via Boost wrote:
> On 3/18/2017 6:55 PM, Zach Laine via Boost wrote:
>> I posted 2-3 months ago about Yap, an expression template library I've
>> written that I intend to propose for Boost.
>>
>> This is just a reminder that the library exists, and where to find it.
>>
>> I'm giving a talk about it at C++Now 2017, and some time after that I
>> intend to submit it to the queue. Louis Dionne has offered to serve
>> as
>> review manager when the time comes.
>>
>> You can find the main repo on GitHub:
>>
>> https://github.com/tzlaine/yap
>>
>> And online docs are here:
>>
>> https://tzlaine.github.io/yap
I hope it is okay that i answer to this mail, I could not find the mail
above in my inbox/trash/junk.

I had a short glimpse over the tutorial and I like that you managed to
solve the temporary argument problem. Still, a few of my "more advanced
problems" seem not to be discussed in the documention.

So, some questions:

1. You discussed transforming an expression into its arity. What about
more complex expression transformations? my expression template
code[1][2] is riddled with meta-expressions intended to bring the AST
into some normal form so that i can apply optimizations like (M1*M2)*v =
M1 * (M2 * v) (where M1 and M2 are matrices and v is a vector). In
general I only consider transformations of the AST of the form

transform(Node(Arg1,Arg2))= NewNode(transform1(Arg1),transform2(Arg2))

Does yap come with support for such transformations? How would such a
transformation interact with captured rvalues?

2. is it hard to implement variable tagging? (e.g. for checking whether
a specific variable occurs in the expression).

3. How does the library handle variable aliasing, i.e. a variable being
on both sides of an assignment.

4. if 1. and 2. work easily: How hard would you consider an
implementation of auto-differentiation? e.g. given an expression and a
tagged variable, transform the expression into its derivative? Bonus
points for reverse accumulation [3]

[1]transformations:
https://github.com/Shark-ML/Remora/blob/master/include/remora/detail/expression_optimizers.hpp
[2] operators example:
https://github.com/Shark-ML/Remora/blob/master/include/remora/vector_proxy.hpp#L48
[3]
https://en.wikipedia.org/wiki/Automatic_differentiation#Reverse_accumulation


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