News for hackers. Stuff that matters.
Re:The Unix Philosophy by lmm on Thursday June 25, 2015 @07:41AM (#9777172)
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".
Re:The Unix Philosophy by nly on Thursday June 25, 2015 @08:21AM (#9777329)
Thrift 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.
Re:The Unix Philosophy by cfallin on Thursday June 25, 2015 @12:28PM (#9779066)
Protobufs 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

Re:The Unix Philosophy by coderjames on Thursday June 25, 2015 @12:22PM (#9779017)
Protobuf 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#on...