Boost logo

Boost :

From: Darryl Green (darryl.green_at_[hidden])
Date: 2023-02-18 23:55:33


On Sun, 5 Feb 2023, 1:56 pm Klemens Morgenstern via Boost, <
boost_at_[hidden]> wrote:
>
> The formal review of the mustache starts today, Sunday the 5th, and ends
> next week on Tuesday the 14th.
>
> The library was developed & submitted by Peter Dimov.
>
> Boost.Mustache is an implementation of Mustache templates in C++11.
>
This is useful. I've used Mustache before and while its specification is
somewhat quirky and in particular oriented towards html templating, this
usage is a genuinely common, and also non-trivial use case. Having easy to
use support for this with/in C++ helps to make C++ usable in a web "world"
for user facing purposes with server side rendering.

That said, I have used this type of templating for "plain text" and JSON as
well as HTML. Specifically where a configuration file specifies a template
used with runtime parameters. In future I would use this library for such
purposes as well as in a html context.

No doubt there are many other uses for simple templating capabilities.

> Review
> ========
>
> Please explicitly state that you either *accept* or *reject* the inclusion
> of this library into boost.
> The accept can be conditional.

Conditionally ACCEPT. The condition is to provide documentation that is
stand alone from external Mustache documentation, sufficient to understand
and use the library and not require reference to external documentation for
terms used in Mustache.

I would like to see (but this isn't a condition) separation of the output
rendering/escaping to allow customisation - not only the choices in the
Mustache specification.

I would like to see lambda support but that's an interesting area to
consider as an extension of boost.json (to allow values that are functors
taking and returning a json type).

>
> Also please indicate the time & effort spent on the evaluation

A few hours.

Reviewed the implementation (clean, simple, and by relying on describe and
json libs providing a consistent (with other use of structured data in a
program) and capable interface.

> and give the
> reasons for your decision.

> - Does this library bring real benefit to C++ developers for real world
> use-case?

Yes as outlined above it has utility. And its use of describe and json as
vocabluary type is preferable to the alternative presented by the mstch
library.

> - Do you have an application for this library?

Yes as outlined.

> - Does the API match with current best practices?

Yes.

> - Is the documentation helpful and clear?

Yes but too much reliance on the less than helpful and clear external
Mustache documentation.

> - Did you try to use it? What problems or surprises did you encounter?

No. I had no immediate need to change existing code. I was pressed for time
and sufficiently convinced by the implementation and examples to see what
was in the packet and that it did what it said.

> - What is your evaluation of the implementation?

It's small, clean and has a similarly small and clean interface. I like it.
The efficiency issues arising from the reliance on/conversion to/through
the boost.json vocabulary type are somewhere between non-existent (I have a
real use case for rendering from a received json object) and acceptable
(boost.json is efficient as such things go). The async/streaming
capabilities and clean interface using existing vocabulary types
(vocabulary meta-types in case of describe?) of the library are more
important to me than the very last bit of efficiency.

Regards
Darryl Green.


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