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
Louis Dionne
@ldionne
@awgn I looked at your Cat library, and it is not reinventing Hana in the following sense: Cat manipulates sequences whose length is known at runtime, whereas Hana manipulates sequences whose length is known at compile-time. This distinction makes a huge difference because it allows Hana sequences to hold objects with different types, but then you also lose a lot of properties like being able to append a runtime-known number of elements to a Hana sequence.
Manu Sánchez
@Manu343726
And to index those sequences at runtime :(
Louis Dionne
@ldionne
Yeah, but it only makes sense when you think about it; the type of the returned value would have to depend on a runtime integer, which is impossible. You need to use a dependently-typed language for that (Agda, Coq & al, I'm not too knowledgeable there).
@Manu343726 , How does your curry utility handles variadic metafunctions?
When does it stop evaluating? IIUC, it will stop at the first argument. For example, how would you curry the following:
template <typename ...T>
struct pack_size {
    using type = std::integral_constant<std::size_t, sizeof...(T)>;    
};
Nicola Bonelli
@awgn
Sorry guys my GF is reclaiming me... Talk later 😒
Manu Sánchez
@Manu343726
@ldionne good catch ;) It doesn't, since a variadic template is always instantiable regardless of the arguments. What I have is a Continue tag. $(f, a, b, c, Continue), where fis a variadic metafunction.
Louis Dionne
@ldionne
@Manu343726 From my current understanding, it is impossible to automatically curry variadic metafunctions (or functions for that matter). The user has to say "consider this function as a __n -ary function for currying".
How does the continue trick work?
Manu Sánchez
@Manu343726
Checking the back argument prior to evaluation. I have played with a Curry tag that comes at the beginning too, just to make the thing O(1).
Louis Dionne
@ldionne
Ok, so before you evaluate the thing, you check whether it's got a Continue tag at the end, and if so, you just return the expression as-is instead of fetching the nested ::type?
Manu Sánchez
@Manu343726
Exactly, I return a closure (The type struct in the false specialization of call above.
eval_mc means "evaluate metafunction class" just typename F::template apply<Args...>::type less ugly
Louis Dionne
@ldionne
Oh, ok I get it.
Manu Sánchez
@Manu343726
Hey, I finally got gcc-clite working. The latest release (gcc-clite 0.3) starts from GCC 4.8.0, so I'm not sure if this will work with hana since it relies on C++14. I will check the GCC features table now.
polymorphic lambdas 4.9 ;(
Louis Dionne
@ldionne
No, it will definitely not work with Hana. Actually, I’m working on a port of Hana for GCC 5 but it’s still not done.
Anything below GCC 5 is very unlikely to work. I’ve tried it before, but we have to reduce the functionality so much that it becomes less usable. For example, no generalized constexpr and no variable templates basically destroys Hana.
But GCC5 got all that, hence the ongoing port.
Manu Sánchez
@Manu343726
I haven't found any other experimental implementation of concepts lite. Nothing from the llvm guys.
Louis Dionne
@ldionne
Crap
Manu Sánchez
@Manu343726
There is a thread at the iso c++ google groups list on the topic: https://groups.google.com/a/isocpp.org/forum/#!topic/concepts/uNVfp04qN64
Louis Dionne
@ldionne
Hmmm… Would there be a way to prototype something without using Hana per-se? E.g. implementing a similar framework, but naively, which would reduce the complexity of implementing it from scratch by a lot?
Manu Sánchez
@Manu343726
Well, defining a library of concepts using Concepts Lite, and then add those to Hana in the future sounds great for me.
Louis Dionne
@ldionne
Basically, what we’re talking about is implementing Hana’s concept hierarchy (or a similar one) using concepts lite instead of my ad-hoc tag-dispatching system, right?
Manu Sánchez
@Manu343726
Right
Louis Dionne
@ldionne
And then see if we’re able to handle both compile-time and runtime stuff through it?
Manu Sánchez
@Manu343726
Yep
Louis Dionne
@ldionne
Ok, we’re on the same page. Then, it should suffice to consider a very much simplified version of Hana. Basically, it would be useful to see if you’re able to handle compile-time optionals (hana::Maybe) and compile-time sequences (hana::Tuple) through such a hierarchy, but no need to define 1000x algorithms like hana::Sequence does.
Manu Sánchez
@Manu343726
Looking at your implementation, Hana internals are mostly C++11. Template variables, generic lambdas, etc are more part of the user side, right?
Louis Dionne
@ldionne
There’s also generalized constexpr and automatically deduced return type, which are quite important.
But if we’re only considering a barebones frame of the library, without providing a lot of algorithms, we might be able to reduce the requirements to C++11.
Manu Sánchez
@Manu343726
Let's translate your existing concepts to gcc-clite then, and see how they work.
Louis Dionne
@ldionne
Yeah, I think that’s the way to go.
Manu Sánchez
@Manu343726
We could get concepts from range_v3 too.
Louis Dionne
@ldionne
Probably, but I’m not too familiar with the proposal since I’ve been working on Hana. One thing that will probably hurt is the presence of iterators and sentinels. Since we want to have type sequences, an iterator should “point to a type”. When you increment it, the type it points to must change, and so the type of the iterator itself must change. This precludes stuff like iterator++.
Manu Sánchez
@Manu343726
Okay, let's get simple and start with Hana only.
Manu Sánchez
@Manu343726

I don't know what OS/distro you use for development. I'm an ArchLinux guy, so I have submitted a gcc-clite package to the repository: https://github.com/Manu343726/gcc-clite-aur

$ yaourt  -S gcc-clite

should work. It builds gcc from scratch, so be patient and go for a coffee :)

Louis Dionne
@ldionne
I’m on OS X :worried:
I should be able to simply build it by hand
Manu Sánchez
@Manu343726

Check sources https://github.com/Manu343726/gcc-clite-aur/blob/master/PKGBUILD It's just a plain call to gcc configure script plus some sed replaces to fix issues related to the legacy texinfo version they are using for the docs.

mkdir build 
cd build

# Patch texinfo >= 5.0 issues. See https://gcc.gnu.org/bugzilla/attachment.cgi?id=29520&action=diff
sed -i -- 's/@itemx/@item/g' ../gcc-clite-0.3/gcc/doc/*.texi

# Configure (Note --disable.werror)
../gcc-clite-0.3/configure --disable-werror --program-suffix=-clite --program-transform-name='s/^gcc$/gcc-clite/g' --enable-languages=c++

make
make install

Check GCC install docs too.

Louis Dionne
@ldionne
Yeah, I think I’ll be OK. I already have a GCC trunk so I’m familiar with the process (but the first time I did it was f*cking painful).
Louis Dionne
@ldionne
@Manu343726 I’m building GCC-clite right now; everything seems fine so far.
Manu Sánchez
@Manu343726
I'm testing concepts with Turbo. This is so awesome
definitely concepts are the right way to go for algebraic datatypes and typeclasses
Manu Sánchez
@Manu343726
There is no fancy "X does not satisfy Y concept" error message though. Just ignores the template. At least there's no 100k lines error like with SFINAE.
Louis Dionne
@ldionne
Exciting.
Can you put your experiments in a repo so I can watch it?
Manu Sánchez
@Manu343726
sure. I'm playing with Turbo datatypes now. I have added a concepts-lite branch, file examples/main.cpp.