Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2019-12-08 19:09:43

On 12/8/19 10:47 AM, Vinnie Falco via Boost wrote:
> On Sun, Dec 8, 2019 at 10:44 AM Robert Ramey via Boost
> <boost_at_[hidden]> wrote:
>> ...
> This all makes sense*. Please answer this question:
>> Should there be a JSON archive for Boost.Serialization?

If someone wants it. sure. but I don't recall anyone actually asking
me for this. Given the example of XML, it wouldn't be hard for people
to make their own and perhaps people have with out advising me. I'm
aware that many have made their own special purpose archive classes -
handling complex floating point, versions which avoid using the file
system and copy to memory for extra speed, etc. And of course one can
pipe the output/input of any archive class through boost iostreams for
encryption, compression etc. The boost serialization library is not a
library of archive classes, it's a library to build archive classes and
it includes a few examples.

> If your answer to the question above is yes then please answer this question:
> What is the benefit of a "JSON archive" that is not achieved with
> other archive types?

For my purposes - nothing. The text version is just fine. But I felt
the same about XML and some people found a use for it. (I actually use
it to display my archive data when I have the read/write out of sync).
I suppose there's someone who uses xslt to convert the XML archive into
something displayable like PDF or html. But I haven't had occasion to
do this. I do know that some people have edited the XML archive with
some success. One can't add / delete fields but altering the values in
place would work and might be useful. I once under took a project to
make an archive class which would produce an editable form - a very
interesting idea - but I lost interest in it. Sooo someone could find
JSON useful for some special purposes.

My real problem comes when people believe that the serialization library
which is very easy to use can/should be able to do what google protocol
buffers does. It's not possible because it's a different job.

B/S C++ data structures <-> byte stream

G/P/C GP C++ data structures <-> byte stream
                 custom C++ or other language code

So if you want to explore how your JSON parser might be involved in an
alternative to google protocol buffers, that might be an interesting
idea - so you might find it interesting to take a look at google
protocol buffers - which BTW is likely more popular than Boost
Serialization any way.

Boost list run by bdawes at, gregod at, cpdaniel at, john at