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?
Anyway, I'd like to have a look at your Phoenix-lite project, to see if it could be written using Hana, and how so. It is also definitely possible that no gains can be obtained from using Hana in that project, in which case that would give me a good example of what _not_ to use Hana for.
There are other issues, such as debuggability of TMP code using the lambda trick, if you are still using that for CT efficiency, but I guess I need to dive deeper to give a real review. Not being able to debug TMP code is a showstopper for me.
I'm not using the lambda trick anymore because of shabby support for generic lambdas and the lack of constexpr lambdas.
Ok, so what new tricks are you using to speed up compile time then? In my experience, the main reason for excessive compile time are the long type names. How are you able to overcome that? regards, -- Joel de Guzman http://www.ciere.com http://boost-spirit.com http://www.cycfi.com/