Boost logo

Boost :

Subject: [boost] [metaparse] review
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2015-06-03 11:07:06


Hi,
I wish I had more time to thoroughly review and test the implementation,
but as this is not possible I will have to take risk and vote without the
in-depth investigation.

I vote YES, this library is needed in Boost.

Although it will be used only by a fraction of community, it is an
essential complimentary part to the Standard C++ user-defined literals (in
raw form). The Standard offers a way to decompose a a user-defined literal
into a sequence of characters each passed as a separate template argument.
This enables to build at compile time constants of user defined numeric
types, but doing it is hard, and the Standard offers little help. This is
where Abel's library comes into rescue. Although it was designed to do much
more, it also fills this sort of hole in the Standard.

I have read Abel's posts, and know he has been working on the subject for a
couple of years now, so I am confident in his competence.

In a way, I see two components inside:
(1) A tool for converting a string literal into instantiation of string<>
template.
(2) tools for parsing those string<>s.

I see use cases for each of these components separately. Parsing templates
with characters, is painstaking but fairly easy, so I may want to do it
myself, provided I have a way to convert a string literal to a template. I
was trying to hack it for a long while, without success. There is quite a
bit of trickery put into it. It is really ingenious.

On the other hand, when processing my raw user-defined literals, I may need
your parsers, but I care not about BOOST_MS_STRING() (or how you want to
call it).

The standard questions:

- What is your evaluation of the design?
>
Adequate: this is string parsing what the library does, so the parser
interface seems the right choice.

> - What is your evaluation of the implementation?
>
I haven't looked at the parsers. Regarding, BOOST_MS_STRING(), it is a nice
trick to implement the impossible.

> - What is your evaluation of the documentation?
>
Well, after having read it, I understood what to expect of it, so in that
sense, it is adequate. But there is something about it that makes it
"heavy". Maybe it is just the problem domain, I do not know.

> - What is your evaluation of the potential usefulness of the library?
>
It is useful, although to a fraction of community: libraries with
user-defined literals, printf, other EDSLs.

> - Did you try to use the library?
>
I tested BOOST_MP_STRING() (couldn't believe it works).

  - With what compiler?

MinGW on Windows, GCC 4.8.2

  - Did you have any problems?
>
Nope

> - How much effort did you put into your evaluation? A glance? A quick
> reading? In-depth study?
>
I read the docs (not all of them); downloaded and played with
BOOST_MP_STRING(). -- two hours.

- Are you knowledgeable about the problem domain?

I never had to do parse at compile time for my commercial programs, but as
a hobby I studied the subject, and have even written some posts about it.

Thanks Abel, the library is cool.
--&rzej


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