I came up with the idea when I was writing my GPU-based recurrent neural network (still to be posted...). You think about things like this when you're writing out page after page of tensor derivatives. "Why can't C++ do this for you?" I did see a C++ alternative compiler that had a built-in differentiation attribute or something like that. I believe saw it used for the Witkin & Kass Spacetime Constraint paper. But yeah, why bother use another compiler when you can just do it in C++?
Constants, variables, expressions, functions. Chain rule, product rule, and predefined derivatives for all the predefined functions. If you stray over to my vector math library then there is even gradient support.
I'll put some better documentation here soon. Enjoy!