Boost logo

Boost :

Subject: Re: [boost] [GSoC] [Boost.Hana] Formal review request
From: pfultz2 (pfultz2_at_[hidden])
Date: 2014-07-29 17:17:54


Awesome library! Here are some of my thoughts on the library.

It seems like you are bringing haskell to C++. However, in the past,
functional libraies seem to struggle with acceptance in boost. It seems like
it would be nicer to name and organize things in a way that is familiar to
C++
programmers. One of the things that helped make it easy for me when I
firsted
learned Boost.MPL, was it was built around the STL interface. I understand
in
Boost.Hana, you don't use iterators for performance, but it still could be
organized in a way that is more familiar to C++ programmers(Some places I've
worked, there was resistance to even using Boost.Fusion, which is built
around
familiar C++ interfaces. Imagine if I tried to introduce Boost.Hana.)

Here's a few list of names off the top of my head that could use more
C++-like
names:

foldl = fold
foldr = reverse_fold
fmap = transform
cons = push_front
scons = push_back
datatype = tag,tag_of
head = front
last = back
typeclass = concept

Also, most C++ programmers are used to seeing libraries divided into
containers and algorithms, whereas Boost.Hana seemed to be built around
haskell-like interfaces. As C++ programmers, its difficult to find where to
look for functionality. Ideally, it would be nice to start with simple
concepts, such as iteration, and then have algorithms built on top of that.
And then have a mechanism to overload algorithms to improve the performance
for certain sequences(for example `mpl::vector` algorithms could be
specialized to improve compile time performance).

It seems like you can overload the algorithms in your library, but its
spread
across different typeclasses. And then the `List` typeclass has a bunch of
algorithms in them. Since, `List` is heavy, I can't split the
specializations
of these algorithms across several header files, for example. It would be
better to have smaller and simpler concepts. However, the specializations of
these concepts should be for advance use of the libraries. It should start
with some simple concepts to get people to start using the library, and then
if someone wants to create an optimized `reverse_fold`, they could.

It would be nice to see the docs divide into something like:

- The basic type concepts(such as `type<>`, integral constants,
metafunctionn,
  etc)

- The basic sequence concepts, what concepts are necessary to define a hana
  sequence, and the different sequences

- Accessing data from a hana sequence, such as `at`, `front`, `back`

- Views or adaptors on sequences, such as filter, transform

- Algorithms on sequences, such as `fold`, `max`, etc

- Extending Boost.Hana

Those are some thoughts after reading through the library. Perhaps, I missed
some design goals you have.

--
View this message in context: http://boost.2283326.n4.nabble.com/Re-GSoC-Boost-Hana-Formal-review-request-tp4665622p4665722.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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