|
Boost : |
Subject: Re: [boost] [hana] some notes, not a review
From: Louis Dionne (ldionne.2_at_[hidden])
Date: 2015-06-18 16:33:10
Phil Endecott <spam_from_boost_dev <at> chezphil.org> writes:
>
> Dear All,
>
> I have just a couple of notes about Hana; this does not
> constitute a review:
>
> Firstly, as I understand it Hana believes that it can replace
> much or all of what Fusion and MPL provide with a superior
> alternative. If that is the case, I suggest that the docs
> should not start out by describing Hana with reference to
> those libraries. At present, it would seem that in order to
> understand what Hana can do for me, I need to first learn at
> least a little about those other libraries - and then the
> Hana docs tell me how it compares to them. This might not
> be a bad thing in the context of docs for this review, but
> for "end user" documentation it should stand alone.
I agree that the documentation _could_ be more self-contained. However, I
am not sure it _should_ be. Indeed, I am OK with offloading some of the
explanation about "what is template metaprogramming" to other resources,
since the tutorial would otherwise double in size.
When looking at Fusion's documentation, for example, they cite MPL to
introduce their own work. And for the MPL, they wrote a book to explain
"what is C++ template metaprogramming".
So, while you are definitely correct that Hana's tutorial is not self-
contained, I will not take direct actions to change this unless at least
a couple of persons express this desire, since that's a lot of work (and
not especially pleasant work either).
> Secondly, we're moving towards a future where a lot of what
> previously required TMP can now be done using "regular" C++
> code qualified with constexpr. I've just replaced a fair
> chunk of my crufty old TMP code with constexpr and it is
> like a breath of fresh air. Against that background, it
> might be worthwhile to structure your examples by showing
> what Hana (and TMP in general, perhaps) can do that
> constexpr cannot do, i.e. start with an example using
> constexpr and extend it to add features not possible with
> constexpr.
I guess it really depends on what kind of TMP code that was. Type-level
computations and heterogeneous computations (like Fusion) are not impacted
by constexpr. This distinction is partly what I wanted to make in the
introduction (the quadrants of computation), but it seems like I could
show clearer examples of where homogeneous constexpr computations differ
from heterogeneous computations.
Is this distinction (between homogeneous-constexpr computations and
heterogeneous computations) what you would like to see exposed more clearly?
Thanks for your comments,
Louis
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk