News for hackers. Stuff that matters.
Re:Protobuffers Are Wrong (2018) by lmm on Thursday March 23, 2023 @07:38PM (#35283083)
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.

Re:Protobuffers Are Wrong (2018) by vlmutolo on Thursday March 23, 2023 @07:48PM (#35283155)
Typical 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