I'd be interested to see a "why?" section in your docs. In general I think making new "skins" for the same underlying tech is not a good thing. It fragments the ecosystem without any real business purpose. Is there some problem this addresses that is not already solved equally well by proto2 or proto3, besides that it doesn't look like a particular programming language?
Gunk: Modern front end and syntax for Protocol Buffers
21–30 of 42 posts
Re: Gunk: Modern front end and syntax for Protocol Buffers
#22We just pushed the first initial, public release of Gunk, a modern frontend and syntax for Protocol Buffers. Check out releases here: https://github.com/gunk/gunk/releases/tag/v0.1.0 Please note this is still extremely early / alpha stage, but we are soliciting feedback on our initial design. We hope to make this project useful to the greater developer community.
This is pretty cool. Have you all looked at the annotations to build pb in kubernetes? They use proto2 so they can use optionality, but they use a lot of annotations to write the pb like this project.
Re: Gunk: Modern front end and syntax for Protocol Buffers
#23Earlier quoted context omitted.
Thanks for the input -- this actually does support enums, using a variant of Go's const: type MyEnum int const ( MYENUMVAL MyEnum = iota ) It's a philosophical argument, but one should not design a protocol using "oneof". I believe that's a relic from proto2, and I'm not aware of any modern APIs published by Google, that make use of "oneof" in anything but a legacy capacity. Gunk is not for old protobufs, it's for ne…
I was curious about this claim, so I searched for oneof in the googleapis repo[0][1]. There's a bunch of results, all in proto3, and many were committed for the first time (at least publicly) in the last 4-6 months. So I don't believe this is true. From a safety perspective, tagged union types, which oneofs are, are incredibly useful and really should be used more often. [0]: https://github.com/googleapis/googleapis/…
Re: Gunk: Modern front end and syntax for Protocol Buffers
#24Earlier quoted context omitted.
Thanks for the input -- this actually does support enums, using a variant of Go's const: type MyEnum int const ( MYENUMVAL MyEnum = iota ) It's a philosophical argument, but one should not design a protocol using "oneof". I believe that's a relic from proto2, and I'm not aware of any modern APIs published by Google, that make use of "oneof" in anything but a legacy capacity. Gunk is not for old protobufs, it's for ne…
I just can’t get my head around this reasoning, it’s just as valid to ask for/return a “foo OR bar” as it is to ask for a “foo AND bar”. Any protocol that rejects that pushes that complexity elsewhere, somewhere less explicit.
Re: Gunk: Modern front end and syntax for Protocol Buffers
#25I'm not seeing what makes this "modern". proto3 is only a few years old and nothing about it strikes me as unusually archaic. Protobuf in general isn't that much older than Go. I can see why Go-compatible syntax would be attractive to Go developers, so maybe that should be in the description rather than "modern"?
Re: Gunk: Modern front end and syntax for Protocol Buffers
#26Earlier quoted context omitted.
Thanks for the input -- this actually does support enums, using a variant of Go's const: type MyEnum int const ( MYENUMVAL MyEnum = iota ) It's a philosophical argument, but one should not design a protocol using "oneof". I believe that's a relic from proto2, and I'm not aware of any modern APIs published by Google, that make use of "oneof" in anything but a legacy capacity. Gunk is not for old protobufs, it's for ne…
I'm curious, in your view, why should protocols not use "oneOf"?
Re: Gunk: Modern front end and syntax for Protocol Buffers
#27Earlier quoted context omitted.
Thanks for the input -- this actually does support enums, using a variant of Go's const: type MyEnum int const ( MYENUMVAL MyEnum = iota ) It's a philosophical argument, but one should not design a protocol using "oneof". I believe that's a relic from proto2, and I'm not aware of any modern APIs published by Google, that make use of "oneof" in anything but a legacy capacity. Gunk is not for old protobufs, it's for ne…
Oneof exists in proto3, so a tool that doesn't enforce it is likely to create messages that don't conform to the schema. The style guide also doesn't discourage it. https://developers.google.com/protocol-buffers/docs/proto3#o...
Re: Gunk: Modern front end and syntax for Protocol Buffers
#28Earlier quoted context omitted.
I was curious about this claim, so I searched for oneof in the googleapis repo[0][1]. There's a bunch of results, all in proto3, and many were committed for the first time (at least publicly) in the last 4-6 months. So I don't believe this is true. From a safety perspective, tagged union types, which oneofs are, are incredibly useful and really should be used more often. [0]: https://github.com/googleapis/googleapis/…
In proto3 all fields are optional. As such, I don't see the need for "oneof" since you should check in business logic whether or not the field is there. By using "oneof" you are declaring two different types can be the same name. It's a philosophical argument that you're free to disagree with.
Re: Gunk: Modern front end and syntax for Protocol Buffers
#29Earlier quoted context omitted.
I just can’t get my head around this reasoning, it’s just as valid to ask for/return a “foo OR bar” as it is to ask for a “foo AND bar”. Any protocol that rejects that pushes that complexity elsewhere, somewhere less explicit.
I feel very strongly that type safety is of paramount importance in development, and "oneof" (and other similar constructs) in protocol design breaks fundamental ideas of type safety. It's a feature of the IDL that doesn't translate well to the actual implementing language, is not strictly necessary as the same thing can be accomplished through other designs that have an added benefit of being more explicit, both to…
Re: Gunk: Modern front end and syntax for Protocol Buffers
#30Earlier quoted context omitted.
In proto3 all fields are optional. As such, I don't see the need for "oneof" since you should check in business logic whether or not the field is there. By using "oneof" you are declaring two different types can be the same name. It's a philosophical argument that you're free to disagree with.
In good proto2, all fields are optional, that doesn't negate the uses of one of, which provide compile time validation instead of runtime, which is the important part.