Boost logo

Boost :

Subject: Re: [boost] [metal] Feature Complete - Request for Feedback
From: Deniz Bahadir (dbahadir_at_[hidden])
Date: 2017-02-21 13:38:53


Am 21.02.2017 um 14:03 schrieb Bruno Dutra via Boost:
> On Tue, Feb 21, 2017 at 10:53 AM, Hans Dembinski <hans.dembinski_at_[hidden]>
> wrote:
>>
> [...]
>
>> I suppose my big question is this: can't you just merge your
>> ideas/improvements into boost::mpl? With ifdefs you could enable C++14
>> features like templated aliases when they are available. Even more so, it
>> should be possible to merge your speed improvements into boost::mpl.
>
> It does sound like a good idea from the user's point of view since Metal
> looks so similar to MPL, but because they are so drastically distinct
> internally, merging them into a single library doesn't really make any
> sense. Fortunately, if you are coming from some legacy metaprogram, it is
> easy to incrementally migrate to Metal using the helper metal::from_mpl,
> but there is really no reason to ever use MPL anymore on a new project.

Could you elaborate a little more on this metal::from_mpl?
How is it used?
Can I just replace all occurrences of "boost::mpl" in any code by
"metal::from_mpl" and it works?

>
>> I also looked at your benchmarks and they are a bit confusing. I am
>> mostly interested in how your lib compares to the mpl, but not all
>> benchmarks have mpl data, and those that have (see at or count_if) only use
>> up to 50 elements. Is that a hard limitation of the current mpl
>> implementation?
>
> Unfortunately that is indeed a hard limit of of Boost.MPL. Just like
> mpl::quote, everything else in MPL had to be implemented by enumerating
> every possible combination of arguments, which implies that some hard limit
> must have been chosen. That limit is 50 to sequence sizes and 15 to
> mpl::quote, mpl::apply and their friends.

Just a short note:

You can increase this upper limit by changing the values of some
Boost.MPL macros and pre-generating headers for Boost.MPL-containers
with these new values. For this, some python-scripts exist in
"libs/mpl/preprocessed".
However, they stopped working after the migration to Git from
Subversion. And they were pretty complicated to use (and understand).

Therefore, a few years ago, I created some helper python-script
"boost_mpl_preprocess.py" which fixes pre-generating the headers and
greatly simplifies the process. It is also located in the same directory
in Boost-source since Boost 1.59.
Just call it like this to see the options and its usage:
   python boost_mpl_preprocess.py --help

At our company we had to increase the number of elements to 100 and it
works fine except for the obvious reasons Bruno already talked about. It
is so damn slow and wastes so much RAM that we can only compile
single-threaded which slows down compile-performance even more.

That is why I am so interested in a drop-in replacement for Boost.MPL
and asked about metal::from_mpl above.

> [...]
>
> Regards,
> Bruno

Thanks,
Deniz


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