Boost logo

Boost :

Subject: Re: [boost] Hana Typeclass
From: Larry Evans (cppljevans_at_[hidden])
Date: 2014-08-04 13:26:34


On 08/03/2014 05:30 PM, Robert Ramey wrote:> Louis Dionne wrote
>> Robert Ramey
>> <ramey <at>
>> rrsd.com> writes:
[skip]
>
> One thing that the documentation needs is a good motivating example(s).
> The user should be able to look at this and in 1/2 hour know how this is
> going to make his life easier. Here's an example
>
> the 8 queens problem:
>
> a) class C++ solution using mutable objects, containers, etc.
> b) solution using HANA
> 1) why it's more verifiably correct
> 2) why it's shorter
> 3) why it's faster
> 4) why it's faster than the same algorithm rendered in Haskell
> c) scale to N queens
>
> See http://cppnow.org/schedule-2014/
>
> Regards,
> Louis

Another good motivating example would be something like spirit,
although, to make a good example, it would have to be extremely scaled
down from spirit, but would have the essentials, such as:

  1) some way to represent a record of recusive equations ( the
     grammar productions ). This record would actually be a sort of
     fusion-like map from the rhs name or "index" to the corresponding
     lhs expression expression.

  2) some way to compile those productions into a record or map of
     recursive parse functions where, again, the map key would be the
     rhs name and the value would be the corresponding parse
     function. I believe in spirit2 this is what proto did (at least,
     IIRC, there were several transforms with "compile" in their
     names).

I've no idea if this is even possible, but if it is, then to make it
usable, it would have to be as fast or faster to compile than the
current spirit3 implementation which Joel is currently working on:

http://article.gmane.org/gmane.comp.parsers.spirit.general/25490

Compile times were raised as in issue in this thread:

http://article.gmane.org/gmane.comp.parsers.spirit.general/26746

IIRC, Joel used, I think, Argument Dependent Lookup to alleviate the
compile times; however, I can't find the post now. Sorry.

-regards,
Larry


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