On 9/4/12 5:22 PM, Patrick Walton wrote:
One possibility is simply to prepend the metadata with two words: a metadata magic number and a version number. Each time the metadata format is changed, the version number will be bumped. The Rust compiler will bail out with an early error when confronted with a metadata version it doesn't understand. When we migrate to Avro, the version number will be bumped one final time.
I think this would be fine, the question is: will we remember to bump the magic number? You'd have to do it each time you changed the AST, tables, or other (auto- or otherwise) serialized data structures.
Another option would be to expand auto_serialize to generate a "schema" (probably just a hash of the type structures being serialized) and encode that at the front. This would be more work but also something you could not forget to do. I'm not 100% sure how to integrate the "hand-serialized" stuff with the auto_serialized stuff here, though, perhaps just throw in a sequential integer to represent the hand-serialized stuff (which should be phased out anyhow).
Niko _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
