2 ms·
The big problem I've found is serialization of sum types. thrift (or protobuf or any number of similar systems) is very good at serializing most of the data one
by lmm 11y ago
The big problem I've found is serialization of sum types. thrift (or protobuf or any number of similar systems) is very good at serializing most of the data one tends to work with, with declarations that are suitably strict but easy to write. But it doesn't have a good way to represent "this field is an A or a B".
- nly 11y agoThrift has unions, so does Apache Avro. Afaik Protocol Buffers is the only one where you have to string together one yourself with a required tag and a bunch of optionals.
- cfallin 11y agoProtobufs has unions now too (they're called "oneofs"), as of version 2.6.0 released last year: https://github.com/google/protobuf/releases/tag/v2.6.0 https://github.com/google/protobuf/releases/tag/v2.6.0
- coderjames 11y agoProtobuf has somewhat recently added the 'oneof' feature which tries to deal with these union types. The one downside I found when trying to use it was that the 3rd-party C# Protobuf libraries didn't yet support it. See: https://developers.google.com/protocol-buffers/docs/proto#oneof https://developers.google.com/protocol-buffers/docs/proto#on...