Boost logo

Boost :

From: Jens Weller (JensWeller_at_[hidden])
Date: 2023-02-18 23:11:26


Hello Boost Community,

my review on this mustache library.

TLDR: CONDITIONALLY ACCEPT

Conditions mostly on the documentation, I think the further evolution of this library will happen naturally once it is in boost and gets picked up by users.

Review time: about 2 hours

First, I understand that this is kinda niche, and most folks never will have a usecase for this in their career. Maybe also because such a library is not available to them.

So I've spend some time to read the debate and followed along, wondering if I'd write this review, as I do actually have a use case. I'm a boostache user.
In 2014, during C++now this library was created and in later works extended, it is exactly what this new mustache library does: a mustache library for boost.
boostache is still on github for you to see https://github.com/cierelabs/boostache

Sadly, boostache never went to review and has been a little known library used by very few users afaik. My use case is that this powers the part of the CMS where text templates are being used to create the actual website in html code.
I did write this code years ago, and only can scratch the surface of this, but mostly interfacing to boostache has been done via its basic data interface: maps and fusion adapted types if I remember correctly.

On the first view boost::mustache looks like a modern replacement for boostache. I can understand that some of the interfaces go for boost::json, but wonder if boostache went a more lightweight way here with simply having a map<string,variant>. Maybe the boost json type is exactly this or similar. But maybe mustache can learn from boostache, and take add some its interfaces to make transition to a more modern version of a C++ mustache library easier for the users.

From the documentation I think that it is a fairly simple library at the moment, which may see added features and growth from being in boost. Using boost::Describe feels right, making the library based on C++11 makes it available for many users. Supporting boost::json is great, but I wonder if its really the best from the usability stand point, does one have to be familiar with boost::json to use this library?

I think the library should take the comparison to boostache, which has more examples in the documentation, and this is where I agree with prior comments: please add more examples and explanations.

One of the biggest headaches with boostache was the compilation time, so I'm glad to see that this library has an implementation based on a cpp file.

> Some questions to consider:
>
> - Does this library bring real benefit to C++ developers for real world
> use-case?
Yes, I think so. In any context you have text templates that have various values to be generated.

> - Do you have an application for this library?
My CMS. meetingcpp.com is currently build as a static website with boostache.
> - Does the API match with current best practices?
For C++11 yes. I assume that boost::string_view is able to convert automatically from std::string_view so that the library plays nice with more modern code bases.
> - Is the documentation helpful and clear?
Yes, but I think it should be updated.
> - Did you try to use it? What problems or surprises did you encounter?
I currently don't have a setup to do this, what I can contribute is my experience with boostache and comparing how the code and supported mustache files look and if this library would be able to replace them. I lack the time to setup a test for this at the moment.
> - What is your evaluation of the implementation?
As stated, the compilation times with boostache weren't so great, so I think its a good start to see that the library actually has an cpp implementation file.
It would be a good idea to run a fuzzer on the implementation, as it parses text.

thanks,
Jens Weller


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