Changes between Version 12 and Version 13 of Annotations


Ignore:
Timestamp:
Oct 16, 2008 10:57:40 AM (7 years ago)
Author:
batterseapower
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Annotations

    v12 v13  
    217217We could use Data to implement serialization, and require that instead of Binary. Advantages are manifold (credit goes to Neil Mitchell for this list):
    218218
    219  * You don't get any additional dependencies (other than perhaps SYB,
    220 which I hope you are going to add for the GHC API data types anyway).
    221 
    222  * You can control the format of the serialisation perfectly, and in a
    223 version independent way.
    224 
    225  * You can add type structure checksums to stop changed types with the
    226 same name being messed around - which should eliminate all heisenbugs
    227 from stale .hi files.
     219 * You don't get any additional dependencies (other than perhaps SYB, which I hope you are going to add for the GHC API data types anyway).
     220
     221 * You can control the format of the serialisation perfectly, and in a version independent way.
     222
     223 * You can add type structure checksums to stop changed types with the same name being messed around - which should eliminate all heisenbugs from stale .hi files.
    228224
    229225 * Everyone can write deriving Data/Typeable with automatic deriving.
    230226
    231  * Data/Typeable seems a much more natural pair of instances than
    232 Typeable/Binary
    233 
    234  * Data has been around and solidified for a lot longer time period, and
    235 isn't likely to change in incompatible ways.
    236 
    237  * You can serialise things into XML etc. without any interface change,
    238 should your requirements change.
     227 * Data/Typeable seems a much more natural pair of instances than Typeable/Binary
     228
     229 * Data has been around and solidified for a lot longer time period, and isn't likely to change in incompatible ways.
     230
     231 * You can serialise things into XML etc. without any interface change, should your requirements change.
    239232
    240233There are some disadvantages:
    241234
    242  * Serialisation will be slower. Not massively slower, but a bit. And
    243 hopefully it isn't a bottleneck anyway.
     235 * Serialisation will be slower. Not massively slower, but a bit. And hopefully it isn't a bottleneck anyway.
    244236
    245237 * Datas gunfold won't be defined for abstract data types or those that omit some fields from gfoldl. This actually bites GHC, because the Template Haskell NameFlavour type had an abstract Data instance like that! I've worked around it by making the Data instance expose the internals of NameFlavour