Boost logo

Boost :

Subject: [boost] [Hana] Review
From: Roland Bock (rbock_at_[hidden])
Date: 2015-06-20 15:00:36


Hi,

Here are my review results:

- Whether you believe the library should be accepted into Boost
Yes.

- Your name
Roland Bock

- Your knowledge of the problem domain.
On the one hand, I do believe to have some knowledge in TMP, being the author of sqlpp11. I have made some minor contributions to early versions of Hana, discussing implementations of type sets and all/any/none. I experimented with the MPL for quite some time before the advent of C++11...

On the other hand, I am almost totally blank when it comes to Haskell or Fusion.

- What is your evaluation of the library's:
  * Design
Awesome. Using template variables to turn types into objects and then treating types and values the same way in most places is very cool.

  * Implementation
I haven't spent too much time on the implementation. I read code around hana::string and hana::all. It was nicely structured and quite readable.

 * Documentation
Impressive already. With all the input from the reviews coming in, it will become even better.

I found navigation/searching a bit awkward sometimes. Personally, I would like more cross links/tables. E.g. functions working with Set (Louis already created an issue on github for this).

 * Tests
To be honest, I did not look at them.

 * Usefulness
We'll see what comes out of it. Which libraries are actually going to use Hana. I'll give it a try with sqlpp11. As others have stated, it might be a bit too much even.

BUT, regardless of how many projects will actually use it, Hana will force some compiler teams to go to great lengths to be able to compile the library. It might also become a benchmark in terms of compile time and the number of generated instructions.

Also, Hana contains a wealth of design ideas, tricks and knowledge for anybody who needs to solve a particular compile time problem. I am sure that many library authors and other developers will benefit from this Hana being available, maintained and developed within Boost.

And Hana has minimal dependencies (just a handful of headers from the standard library). Thus Hana might help to change the impression that many people have of Boost (coming from many established, older Boost libraries): Awesomely cool stuff, but dependencies from all nine levels of hell (aka, you can look, but you better not touch).

To sum it up: Usefulness? Very!

- Did you attempt to use the library? If so:
  * Which compiler(s)?
clang-3.5.1

 * What was the experience? Any problems?
As described in an earlier mail:
  - I tried to use Hana's string UDL (the gcc/clang hack) but failed. Hana is not to blame here, it is rather because of shortcomings in the C++ core language.
  - I thought about using Hana's all/any/none, but my own versions were proven (by Louis himself) to be outstandingly fast, so no reason to switch
  - I thought of switching to Hana's compile time sets, but that seemed like a tough thing to do considering that I am using type sets and Hana is using value sets. Louis showed samples from Zach Laine which would make the transition easier. Actually, something like this should be part of the documentation. Maybe it might make sense to have a collection of migration examples (before/after code)?

That might not sound very successful, but I think it was: While researching how I could achieve my goals I learned a lot about the library.

- How much effort did you put into your evaluation of the review?
Several hours of reading and some tests in combination with sqlpp11.

Remark on compilers:
There was some argument as to whether Boost could contain a library that can only be compiled by one compiler (actually, maybe two in this case). My personal opinion is: Yes, Boost could and should do that if the library complies with a modern version of the C++ standard. Compiler teams take pride in being able to compile boost. If they cannot compile a Boost library, they will try to accomplish that ASAP. This is going to help everyone. It is good to have libraries in Boost that challenge compilers even to the point of breaking one or the other. Trying to work around compiler bugs does not seem right for new libraries.

Thanks to Louis for his library and to Glen for managing the review!

Best,

Roland


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