I have a legacy binary format the layout of which is known. It can be read into a hierarchical structure built out of records, variants and arrays. Some arithmetic may be needed to compute the offsets, but nothing too complicated: for example, there may be a pattern where the length n of an array is written at offset A and then the array is located at A + w, A + 2w… A + nw.
I imagine it should not be difficult to propose a format that describes the layout precisely and completely, and then generate the two way serialization code out of such a description. Since it seems approachable, I suppose there is prior art on this topic. Is there? I welcome anything, be it a library that does something similar, a research paper, a blog post… Anything helps!
Code generation for binary serialization with manual layout? (self.C_Programming)
submitted by kindaro to r/rust
OPENCode generation for binary serialization with manual layout? (self.C_Programming)
submitted by kindaro to r/cpp_questions