These are chat archives for boostorg/hana

20th
Dec 2015
Jason Rice
@ricejasonf
Dec 20 2015 01:45
I think I just answered my own question.
<% if input_size > 10 %>
    #define FUSION_MAX_LIST_SIZE <%= ((input_size + 9) / 10) * 10 %>
<% end %>
why not just input size?
Jason Rice
@ricejasonf
Dec 20 2015 02:57
nm... At least for map, it is not needed when variadiac functions are available.
idk if you can see that
mpl::map craps out with "too many template arguments" because it is using boost/mpl/aux_/preprocessed/gcc/map.hpp with a generated map_20. I'm not sure why the existing mpl benchmarks compile just fine.
lmk if I should do a PR for that, but I just commented out the mpl::map one in the json/ruby file thingy
Louis Dionne
@ldionne
Dec 20 2015 14:49

What is the motivation for using C++ metaprogramming over code generation with Ruby or Python or the like?

Easier integration with the build system. Often, it can be easier to understand. Honestly, every time I've seen code bases with custom code generation, I was like "how the fuck does this work?". Having a single, canonical way of generating code (template metaprogramming) is, I think, a good thing for a C++ programmer.

But if you were asking specifically for the benchmarks, I need to use external code generation because I’m benchmarking the template metaprogramming itself. So if there was some metaprogramming involved in setuping the benchmarks, I’d get the wrong timings.
<% if input_size > 10 %>
    #define FUSION_MAX_LIST_SIZE <%= ((input_size + 9) / 10) * 10 %>
<% end %>

why not just input size?

This rounds up to the nearest multiple of 10 if I'm not mistaken.

mpl::map craps out with "too many template arguments" because it is using boost/mpl/aux_/preprocessed/gcc/map.hpp with a generated map_20. I'm not sure why the existing mpl benchmarks compile just fine.

I think there's no benchmark for mpl::map right now.

Jason Rice
@ricejasonf
Dec 20 2015 16:22
I added one
Louis Dionne
@ldionne
Dec 20 2015 16:51
Oh, right. You’ll have to check at what depth it blows up, and then make sure you don’t go over that depth.
Btw, the Travis builds seem to be stalled right now, so it’s very unfortunate for testing. I contacted the support but they are in vacation until January 4th.
Jason Rice
@ricejasonf
Dec 20 2015 16:52
lol... ouch
mpl::map stalls at 20 😰
Louis Dionne
@ldionne
Dec 20 2015 16:54
Something like BOOST_MPL_MAP_MAX_ARITY
Yeah, you can try increasing the limits with some macros. They are documented in MPL’s documentation.
Jason Rice
@ricejasonf
Dec 20 2015 17:13
Ah, I was missing BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS.
Louis Dionne
@ldionne
Dec 20 2015 19:01
@ricejasonf Thanks for the PR (#226). Note that I won’t merge anything until the CI is back up though, so don’t be surprised.
Jason Rice
@ricejasonf
Dec 20 2015 19:04
np