3 ms·
Missing the point. The whole point of protobufs is to be a stable wire format that's forward compatible. They can't have sum types because you can't add one of
by lmm 4y ago
Missing the point. The whole point of protobufs is to be a stable wire format that's forward compatible. They can't have sum types because you can't add one of those in a forward compatible way; oneof works the way it does because that's the only way it can. (I do think repeated is overengineered and should just be a collection field, which would solve the problem of not composing with oneof, but that's honestly just a minor wart).
Also if your language's bindings don't preserve the relationship between x and has_x and don't play nice with recursion schemes, use a better binding generator! You don't have to use the default one.
- vlmutolo 4y agoTypical is an interesting new serialization format that supports sum types. It introduces a mechanism called “asymmetric” fields that’s pretty clever. https://github.com/stepchowfun/typical https://github.com/stepchowfun/typical