Dear all, Please find attached my review of Hana.
- Whether you believe the library should be accepted into Boost * Conditions for acceptance
Definitely yes. I just have a very minor remark considering the documentation.
- Your name
Edouard Alligand
- Your knowledge of the problem domain.
I have been writing C++ professionally for 15 years and done a lot of TMP for many software project, for things such as compile-time introspection for serialization, enhanced checks at compile-time to improve correctness and compile-time pre-computations. I've done that with Boost.MPL, Boost.Fusion and some custom MPL.
You are strongly encouraged to also provide additional information: - What is your evaluation of the library's: * Design
I am very much impressed by the design of Hana and the cleverness of the usage of C++ 14 lambdas.
* Implementation
As far as I can judge it is very well implemented.
* Documentation
I think writing "using namespace boost::hana" for the documentation is confusion. I know it might be nit-picking, but I think the example is easier to understand when you read struct Fish { std::string name; }; struct Cat { std::string name; }; struct Dog { std::string name; }; auto animals = boost::hana::make_tuple(Fish{"Nemo"}, Cat{"Garfield"}, Dog{"Snoopy"}); instead of struct Fish { std::string name; }; struct Cat { std::string name; }; struct Dog { std::string name; }; auto animals = make_tuple(Fish{"Nemo"}, Cat{"Garfield"}, Dog{"Snoopy"}); Because if you read diagonally (and let's be realistic, we all read diagonally documentation) you might miss what is going on. At least some namespace alias would be helpful. I personally think redundancy is good in documentations.
* Tests
There is a satisfactory number of tests and the developer does continuous integration. The developer tests on several compiler versions at every change which is a must for a MPL.
* Usefulness
Boost.Hana is extremely useful, especially the compile-time introspection it adds. It uses macros but as long as the language doesn't provide features to do compile-time introspection, there is no way around this (that I can think of) It has a lot of algorithms out of the box (at least I couldn't find one I would need that was missing). I like the compile-time arithmetic part of the library and find it very convenient. I'm a big fan of Boost.Fusion and I use Boost.MPL a lot. Hana replaces both libraries and compiles faster at the cost of requiring recent compilers. It is, to me, a very acceptable tradeoff.
- Did you attempt to use the library? If so: * Which compiler(s)
Clang 3.5 on FreeBSD 10.1 and libc++
* What was the experience? Any problems?
The only problem I have with Hana is that it doesn't work with Visual Studio. The lack of VS is the only reason why we didn't adopt Hana on our product. Nevertheless, I don't think it a showstopper. Hana is an advanced MPL and the problem will solve by itself with time. It works, in my opinion, on a sufficient number on platforms at the moment to be accepted into Boost.
- How much effort did you put into your evaluation of the review?
I ran by the examples again as I would if I were trying the library for the first time. I have been following Boost.Hana since Louis' presentation at last year cppcon in Bellevue, Wa. Kind regards. --Edouard
edouard <at> fausse.info
[...]
* Documentation
I think writing "using namespace boost::hana" for the documentation is confusion. I know it might be nit-picking, but I think the example is easier to understand when you read
[...]
Because if you read diagonally (and let's be realistic, we all read diagonally documentation) you might miss what is going on. At least some namespace alias would be helpful. I personally think redundancy is good in documentations.
Good suggestion. I think a `namespace hana = boost::hana` alias would be better than fully qualifying all the names. Added this issue [1].
[...]
* What was the experience? Any problems?
The only problem I have with Hana is that it doesn't work with Visual Studio. The lack of VS is the only reason why we didn't adopt Hana on our product. Nevertheless, I don't think it a showstopper. Hana is an advanced MPL and the problem will solve by itself with time. It works, in my opinion, on a sufficient number on platforms at the moment to be accepted into Boost.
I think acceptance into boost and more wide usage of the library might also push compiler vendors to (properly) support C++14 faster. That's sort of a chicken-and-egg problem; if no one uses advanced features, vendors don't have incentives to implement them and they also can't fix their bugs. On the other hand, once all these features are available and bugfree, users will use them.
- How much effort did you put into your evaluation of the review?
I ran by the examples again as I would if I were trying the library for the first time. I have been following Boost.Hana since Louis' presentation at last year cppcon in Bellevue, Wa.
Thanks a lot for your review, Edouard! Regards, Louis [1]: https://github.com/ldionne/hana/issues/126
participants (2)
-
edouard@fausse.info
-
Louis Dionne