moonblob
moonblob copied to clipboard
A 'debug' mode where type metadata is added even in the binary case
Could be useful to enable a global 'debug' mode where methods like :string and :number etc. add type metadata in the serialized form, so that the deserializer would error if there is a mismatch. Could even go the extra mile and add hint keys that it'd check for a match (eg. :number(100, 'health')) but ignore in non-debug mode.
I'm mostly using this in a multiplayer game scenario and if there are bugs where the receiver isn't gleaning the format properly from the message this would help. I'm just thinking ahead though and haven't hit concrete cases of this yet.