On Thu, Jun 18, 2015 at 11:35 PM, Joel de Guzman
On 6/19/15 9:12 AM, Louis Dionne wrote:
Joel de Guzman
writes: On 6/19/15 3:07 AM, Louis Dionne wrote:
[...]
It's not just about compile time, no. What's more important to me is the conceptual overhead of using another library to do simple things. TMP in what were once TMP heavy libraries used to take a significant amount of code in c++03. Not anymore. Then of course another factor is minimizing dependencies. The less dependencies the better. Zero is ideal.
I understand your point about minimizing dependencies. However, the same goes for any kind of library, TMP or not. At some point, one must draw a line and accept having external dependencies, or eternally reimplement everything from scratch. I guess you are the only one who can decide where that line should be drawn for your own projects, and that's OK.
However, even though you may be content with the ease of writing TMP code in C++14, I think you might be surprised to see how shorter it could be if you used Hana. This is, for example, the case of Zach's Units-BLAS library. It was really quite short with C++14 only, but it was even shorter with Hana. And the code was written with a higher level of abstraction. And in that case, there was even a compile-time speedup over std::tuple + handwritten stuff.
"really quite short" is good enough if the cost is having to depend on a "32k header mega library" as David notes. Not to mention having to learn another library for me and for all future maintainers. So where is the speedup? is it because of std::tuple? If so, why don't you decouple your nice tuple implementation and offer it separately? Or is it the handwritten stuff? If so why? Why can't Zacc use the same tricks that you used in Hana?
I was using effectively the same trick in at least one place, and more ad hoc ones in others. However, after partially converting to Hana, I could see a smaller, and thus more maintainable, code base. As for the "32k header mega library", if it builds faster than the alternative and I don't need to understand much of that interface anyway, I find I don't really care. Zach