Consider adding a schema language, like Capnp, Flatbuffers, and the like. From there, a code generator could, in a first step, generate Rust types with the known bitcode (and/or serde) annotations. In a further step, reliance on proc macros could be eliminated for users who wish to do so, but that is not the main benefit. The main benefits would be two-fold:
- Allow a generic cli tool to accept a schema file and an input stream to translate between the bitcode and a human friendly format for debugging purposes (introspection is a powerful tool when debugging complex problems in distributed systems). Also, versioned APIs could advertise their schema so that not-yet updated clients could fall back to a "dynamically typed" scheme (i.e. (de)serialise to/from a HashMap instead of a native type) to continue working with degraded performance until they can be patched.
- Allow interoperational implementations in other languages to exist.
I am willing to give this a shot myself, but if you stalk me, you'll notice that my own attempts at data serialisation have been lackluster so far, to say the least. Just let me know if you're interested!
Consider adding a schema language, like Capnp, Flatbuffers, and the like. From there, a code generator could, in a first step, generate Rust types with the known bitcode (and/or serde) annotations. In a further step, reliance on proc macros could be eliminated for users who wish to do so, but that is not the main benefit. The main benefits would be two-fold:
I am willing to give this a shot myself, but if you stalk me, you'll notice that my own attempts at data serialisation have been lackluster so far, to say the least. Just let me know if you're interested!