News for hackers. Stuff that matters.
Re:Types as Interfaces by skybrian on Tuesday July 23, 2024 @02:17PM (#41049114)
Protobufs are an interesting hybrid. They assume a common, linear history of schema versions, where all data generators had access to an arbitrary version in that history. The schemas define field ids and types, but not which combinations of fields can show up.

If you can upgrade all the data then you don’t need to worry about versioning,

Or you can do it like HTTP headers and hope for the best.

Re:Types as Interfaces by taeric on Tuesday July 23, 2024 @03:45PM (#41050009)
Protobufs are also a fun place to look for how much debate people will get into regarding required versus optional fields. Your post is taking an implicit "everything is optional" view. But, it does allow you to be stricter.

Common Lisp Object System also touched on all of these ideas years ago.

Re:Types as Interfaces by smackmybishop on Tuesday July 23, 2024 @06:32PM (#41051684)
Everything has been `optional` for about a decade.

> The option to set a field to required is absent in proto3 and strongly discouraged in proto2.

https://protobuf.dev/overview/#syntax

Re:Types as Interfaces by taeric on Tuesday July 23, 2024 @07:06PM (#41051954)
Ah, I dropped off protobuf a while back. I definitely remember a lot of uproar about it, at the time.