If values of a given type are stored on disk, or are sent between different executables, then changing that type or its serialization can result in versioning issues. Often such issues are resolved by either making the deserializer more permissive or the serializer more generous and then reasoning “manually” about the situation. For example, if a record type is stored on disk, one might reason that making the deserializer more permissive by adding a new field with a default value is safe, as old serializations will still be readable. However, as type transformations become more complex, it can quickly become too difficult to make and reason about such changes. There are a few sources of difficulty:
- Libraries for generating serializations from a type may not offer flexible ways for making permissive deserializers and generous serializers.
- Given a pair of a (possibly permissive) deserializer and a (possibly generous) serializer, determining whether or not they’re compatible can be tricky.
- Since non-trivial systems may have multiple executables with multiple channels of communication between them, there must be some method for determining which serializer/deserializer pairs must be checked
- Once you know which serializer/deserializer pairs should be checked, you must also take into account the order of deployment of the various executables. The Trace types library attempts to resolve these problems.