Boost logo

Boost :

Subject: [boost] [serialization] clarify in doc on overview that library does not aim for inter-process communication nor for backward compatibility
From: rafalcpp_at_[hidden]
Date: 2019-04-16 17:26:38


Hello,

Some developers expect archiving or serializing libraries to be backward
compatible, for example if I simply save vector<string> to a JSON, then
files written from program with more modern json library will be
readable on older one and vice-versa.

Boost serialization is instead rather intended to read files created by
same program with same boost version (or read it on a more recent, but
not on older, version of boost).

Could we clarify this with a warning on the Overview page?

Perhaps something along this lines:

"
Warning: please note that the format version may change with
boost.archive library versions, an old program may not be able to read a
format that was designed after it was build.

Explanation: some archive libraries offer long lasting forward and
backward compatibility of the archived data.
For example if your program saves list of book titles into a JSON file,
then if your main program itself does not change you can expect to
always be able to load that json file - even when loading it on old
version of JSON library while archive was saved on a very new one.

This is however *not* the case for this boost archive library (at least
for the default archive classes) - here even if your main program stays
the same then archives written on one using more recent libboost might
be unreadable on ones using older libboost.

This also means that communication between users (e.g. over Internet) by
exchanging archives created by this library will not work in case if
users build the program on their own and build it against different
versions of boost.

Although, a work around exists in form of including specific version of
boost serialization library, and freezing that version, in your program,
if you are willing to stick to one version of this module.
"

Please correct if there are any mistakes (for example if that is
possible in some special way).


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