C++ Logo

std-proposals

Advanced search

Re: [std-proposals] A Minimal JSON Support Library for C++

From: Bjorn Reese <breese_at_[hidden]>
Date: Thu, 15 Feb 2024 20:09:47 +0100
On 2/15/24 18:32, Arthur O'Dwyer via Std-Proposals wrote:

> +1, and also, OP said a few times that he's not interested in text
> processing — which is literally the entire point of JSON!
> It seems like OP has implemented an in-memory data structure more or
> less equivalent to std::map<std::string, std::any>; but the point of
> JSON isn't the in-memory data structure, it's the /parsing from text/

Most JSON libraries have such a data structure (similar to a compiler
AST or an XML DOM.) I assume that the OP is proposing such a data
structure as a vocabulary type in which case it does make sense even
without parsing / formatting.

However, this immediately raises the question why we should standardize
a tree structure were each node can be a value, a vector, or a map,
instead of a generic tree?

Can the data structure hold other data formats? Thiago mentioned CBOR,
but there are plenty of others like MsgPack, UBJSON, TOML, INI files,
etc. Can it hold these data formats without loss of information?

Does the data structure have other use-cass than transmission formats?
For example, would it be useful for holding parsed command-line
options?

Does the data structure work with std algorihms? For prior work on this
see the table at the bottom of:

 
http://breese.github.io/trial/protocol/trial_protocol/dynamic_variable/user_guide/algorithms.html

Received on 2024-02-15 19:09:51