stephenberry / glaze

Extremely fast, in memory, JSON and interface library for modern C++
MIT License
1.22k stars 120 forks source link

Feature: Add `YAML` support #1395

Open helmesjo opened 2 weeks ago

helmesjo commented 2 weeks ago

Now, I assume this is something that is far from the current goal with the project, but I am currently looking into performance issues with yaml-cpp that we use and obviously came to think of glaze.

Given the generic approach to compile time reflection, YAML could very well be an excellent candidate for glaze given how close it is to JSON (technically being a superset of JSON).

Anyways, thought I'd drop it here as something to think about. :)

stephenberry commented 2 weeks ago

Thanks for the suggestion and for your interest with Glaze. More formats are indeed on the roadmap. Recently I've been making the core logic more format agnostic and easier to specialize to support various formats.

The plan is to add more formats like YAML, BSON, etc. but I could use help. Another collaborator is actively developing Erlang binary support, which is planned to be added to Glaze. Glaze already CSV and BEVE support and Mustache support is under development.

Would you be interested in helping develop/support YAML in Glaze? I would be happy to add you as a contributor.

[!NOTE] While we will always need format specific unit tests, a goal is to add a format agnostic unit test that simply serializes and deserializes various C++ structures with a given format type that can be specified in CMake. This will allow us to test large amount of Glaze features with many of supported formats without needing to write additional code for each format.

Format agnostic roundtrip testing will be merged soon in: #1380

helmesjo commented 2 weeks ago

Awesome, and thanks for the writeup. I can't promise anything in the near future, but we'll definitely benefit from having a single dependency (glaze) for our different formats (currently json and yaml) and the performance boost is very much required (especially for debug builds). Feel free to ping this thread when relevant work gets merged, I'll keep my eye on this.