Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 15:06

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 24 07:47

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 23 02:04
    pthom commented #432
  • Jan 18 12:46

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 16 22:27
    ricejasonf commented #434
  • Jan 05 06:22
    ricejasonf commented #330
  • Jan 03 11:40

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 02 00:33
    ricejasonf closed #434
  • Jan 02 00:33
    ricejasonf commented #434
  • Jan 02 00:04
    ricejasonf opened #434
  • Dec 27 2018 13:11

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Dec 22 2018 11:56
    pthom commented #432
  • Dec 22 2018 11:55
    pthom commented #432
  • Dec 21 2018 15:48
    pthom synchronize #432
  • Dec 21 2018 09:19
    sdebionne opened #433
  • Dec 21 2018 00:08
    ricejasonf commented #432
  • Dec 21 2018 00:03
    ricejasonf commented #432
  • Dec 20 2018 23:36
    pthom commented #432
  • Dec 20 2018 23:36
    pthom commented #432
  • Dec 20 2018 23:13
    ricejasonf commented #432
Jason Rice
@ricejasonf
I'm not saying do that, but the idea is that they are the same.
so M would have to consider type_tag and types_tag as interchangeable.
Louis Dionne
@ldionne
Yeah, I understand your idea. I’m trying to see what it changes w.r.t. the ability to make it a Monad.
Jason Rice
@ricejasonf
I think unpack would have to not wrap a member with type if it is a hana::types.
Louis Dionne
@ldionne
I think there’s no level of sophistication that would make it legal for hana::types to be considered a Monad. I’ll let it sink in, though, because there might.
Jason Rice
@ricejasonf
yeah... static_assert failed "hana::equal( hana::monadic_compose(lift<M>, f)(x), f(x) )" :hurtrealbad:
Jason Rice
@ricejasonf
To be a Monad, does it have to be able to work with ANY kind of value? I definitely see that with Sequences as they are meant to be isomorphic.
I think, for my purposes, I will continue to use my empty list, but give it the same unpack specialization for Metafunctions because that is really useful. (or a special function or something)
Jason Rice
@ricejasonf
ricejasonf/hana@e55ef11
Louis Dionne
@ldionne
Technically, a Monad is required to work with ANY type. The fact that it works with anything it what gives us some interesting guarantees (the free theorems). However, I do think it is possible to make a sound Monad that only works on a subset of types, by considering the subcategory formed by those types. But clearly those types have to include M(T) itself, because otherwise we'll encounter the definition problem we talked about before with flatten.
Louis Dionne
@ldionne
@ricejasonf I managed to significantly cut down the compile-times for creating maps. If hana::make_map expects all keys to be distinct, and all their hashes not to collide, then we can create all the buckets in one pass, since we know each bucket will contain one and only one key.
And it seems like this is a reasonable assumption (no hash collisions), since 90% of the time we’re mapping distinct types, distinct integers, distinct strings or something else that won’t have collisions. If you need to allow for collisions, then one can use hana::to_map or use hana::insert recursively.
I’m running the tests now, but if it passes then I’m definitely making the change.
Do you think it’s stupid to have make_map require distinct hashes?
If I’m not forgetting something obvious, it seems like it’s totally reasonable.
Louis Dionne
@ldionne
@ricejasonf All tests are passing (after a tweak to your hash_collision.cpp test). I’ll wait for your thumbs up and I’ll push the change.
Jason Rice
@ricejasonf
👍🏻 Sounds great to me. practical
Louis Dionne
@ldionne
Ok, I’ll go forward with it.
Jason Rice
@ricejasonf
:+1:
Maik Klein
@MaikKlein
Not sure if you find this interesting but I "sort of" showcased the idea of hana in D https://www.reddit.com/r/programming/comments/48dssq/metaprogramming_with_type_objects_in_d/
Louis Dionne
@ldionne
@MaikKlein Thanks for the heads up, I’ll have a look!
Louis Dionne
@ldionne
Screen Shot 2016-03-01 at 08.48.40.png
@ricejasonf This is a benchmark of hana::make_map before and after the optimization I talked about yesterday. I’ll push the changes now.
Louis Dionne
@ldionne
@MaikKlein Cool article! I’m a D illiterate, but I see the idea. Did you measure the compile-times of these metafunctions? Is D doing much better than C++?
Maik Klein
@MaikKlein
@ldionne D is much much faster than C++ for compile time stuff. I could create a few benchmarks maybe later today so that we have some "hard data".
It shouldn't be too hard to create them because you can actually build strings at compile time and compile them at compile time.
I'll let you know when I have something.
Jason Rice
@ricejasonf
:+1:
@ldionne That is a dramatic improvement!
Maik Klein
@MaikKlein
I'll try to stay as close to the benchmarks of hana as possible.
Jason Rice
@ricejasonf
It might be possible to put it in there if we can make a custom target to compile the D version with cmake.
@ldionne Do you know if clang c++1z supports constexpr lambdas? I saw this https://groups.google.com/a/isocpp.org/forum/#!msg/std-proposals/WllUuPBDyxQ/_EF8Ppvh_vQJ
Maik Klein
@MaikKlein
Super rough test, but I replicated https://github.com/boostorg/hana/blob/master/benchmark/filter/compile.hana.tuple.erb.cpp I also do a bit more work at compile time. I build the string and compile to a AliasSeq at compile time and then I filter it. I filter a tuple of 10k integers with isEven. Everything takes 3.7 seconds to compile.
and with 1000 integers it completes in 0.5 seconds.
I am scared to try to compile 100k integers :D
Maik Klein
@MaikKlein
okay I run out of memory
dmd failed with exit code -9. This may indicate that the process has run out of memory.
dub build  4.96s user 4.16s system 35% cpu 25.502 total
Jason Rice
@ricejasonf
What is the 'string' that you are building?
Maik Klein
@MaikKlein
enum types = "AliasSeq!(" ~ iota(0,100000).map!(i => to!string(i)).join(",") ~ ")";
You can basically just use any runtime function at compile time in D
so I just create a list of "1,2,3,4,5,6,7,8,...."
and create a new type tuple based of it AliasSeq!(1,2,3,4,5,6,7,8,....)
do you want to test it yourself?
Jason Rice
@ricejasonf
oh lol.. so kind of like what the eruby stuff is doing
it looks the same too
Maik Klein
@MaikKlein
yeah just with the time that eruby takes
btw how far can you go in hana?