C++ serialization API (diagnostics part 3)
In the previous issue in this series, I described the schema and data elements of the mjlib serialization format. Here, I’ll describe the API used to convert between C++ structures and the corresponding schema and data serializations.
First, I’ll start by saying this API is far from perfect. It hits a certain tradeoff in the design space that may not be appropriate for every system. I have developed and used similar APIs professionally both at Jaybridge and TRI, so it has seen use in millions of lines of code, but not billions by any stretch. It is also mostly orthogonal to the rest of the design, and alternate serialization APIs could be built while still maintaining the performance and schema evolution properties described in parts 1 and 2. Now with that out of the way, the library API: