|
Boost : |
Subject: Re: [boost] [mpl] multiset
From: Eric Niebler (eniebler_at_[hidden])
Date: 2015-03-03 18:56:18
On 2/19/2015 7:02 AM, Niall Douglas wrote:
> On 19 Feb 2015 at 15:39, Vicente J. Botet Escriba wrote:
>> Le 13/02/15 18:03, pfultz2 a écrit :
>>>> I believe however that some people were interested in doing a new C++11
>>>> version of MPL. I think the problem is that every year or so someone
>>>> finds a new fancy way to do meta-programming with the latest C++
>>>> features, with noble goals of unifying MPL and Fusion, so most of these
>>>> rewrites end up as experiments rather than stable libraries.
>>> I think Eric Niebler's meta library is good start for a modern MPL library,
>>> and it doesn't try to unify MPL and Fusion.
>>>
>> +1
>>
>> While I appreciate the work on Hana, I believe a pure meta-programming
>> (pure functional) C++11/C++14 library would make things easier.
>>
>> What about enriching the Eric's library on a GSoC project?
>
> Sufficiently able students are extremely tough to find. Also, Eric's
> Meta is very new, is C++ 14 only, and I assume would internal
> compiler error any MSVC :)
It's C++11 actually, and of course MSVC can't compile it. :-)
> That said if you're willing to mentor such a GSoC Vicente ...
Not sure about the GSoC project idea. I'm pretty difficult to work with
because I have strong ideas about how things should be done. HOWEVER,
there is one interesting research direction that I don't have time to
explore, and that could be an interesting project. (See below.)
I should say briefly why I felt the need to write my own metaprogramming
library. It's *not* (as some here seem to think) because I have no faith
in Hana. Briefly:
- I needed some metaprogramming utilities for my range library, and I
didn't want to take a dependence on an external lib.
- I wanted something small, lightweight and simple.
- I think the C++ standard library needs some utilities for manipulating
variadic parameter packs. After all, they're a core language feature,
and the library should support them. My little lib could easily be
turned into a proposal.
I know only a little about Hana, enough to be excited, impressed, and a
little intimidated by its scope. I admit to being surprised at the
suggestion to use constexpr functions to do pure type-level computation,
but I haven't tried it so I can't speak from experience.
Hana might very well be a good addition to Boost. I think it's an
experiment that should be tried, at least. Given the size and scope of
Hana that the standardization committee would run screaming. (Function
programming! Run away!) Standards work has taken up more of my
attention, so tiny, self-contained libraries that accentuate the
features of the language are more interesting to me these days. But
boost:: and std:: are very different beasts, and I don't use the same
measuring stick for both.
MPL has its place. It's a legacy library. Its design -- STL-like
containers, iterators and algorithms -- is strange for a metaprogramming
library, and it probably wouldn't be designed like that today, but it's
what we've got, and too many things depend on it for us to consider
replacing it now.
I think the future of metaprogramming in C++ is very much an open
question at this point. I see no problem with having 2, 3 or even 4
different metaprogramming libraries of different philosophies and scope
in Boost. Hana should almost certainly be one.
My $0.02.
Eric
[*] My GSoC idea: my Meta library is built around variadic parameter
packs, aka lists, and I think I'm happy with that. But it has been
suggested that it could be built instead around the Foldable concept.
The project would be to redesign Meta around Foldable types, and add
other "containers" to Meta besides lists, like sets, and have the
algorithms work with anything that is Foldable.
-- Eric Niebler Boost.org http://www.boost.org
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk