4 ms·
Out of curiosity: why write proto language implementations rather than protoc plugins?
by jeffbee 4y ago
Out of curiosity: why write proto language implementations rather than protoc plugins?
- jen20 4y ago(I don't work at Buf, but happen to be able to answer this) - the post at [1] describes the rationale for wanting something different than the Google compiler. To my mind I'd rather have something written in Go that I can pull in and version using `go.mod` instead of having to special case a single tool, as well. [1]: https://docs.buf.build/reference/internal-compiler https://docs.buf.build/reference/internal-compiler
- jhumphries131 4y agoA great question: We do plan to add content about the plugin protocol to this site. While documentation for plugins is light, it is easier to find and to get a working plugin than it is to find the information needed, for example, to write a tool that performs static analysis on a protobuf source files. The biggest omission in the existing docs was the specification of the language. Plugins generally require a library for a particular implementation language, so content we write would likely have to focus on a single language and library (at least to start). Whereas a spec is more broadly useful, regardless of what implementation language one is using with Protobuf.
- geraldcombs 4y agoSo that you can analyze and troubleshoot protobuf network traffic? Wireshark has a protobuf parser that integrates with our dissection API: https://gitlab.com/wireshark/wireshark/-/blob/master/epan/protobuf_lang_parser.lemon https://gitlab.com/wireshark/wireshark/-/blob/master/epan/pr...
- jeffbee 4y agoHrmm, I don't see why you would need to think about proto files to do this. You can dissect protocol messages on the wire using the descriptor. In fact, I would say that would be a good improvement to the code you just showed me.