News for hackers. Stuff that matters.
Re:Parsing Protobuf Definitions with Tree-sitter by grumbles on Saturday August 03, 2024 @06:25PM (#41149745)
Huh. tree-sitter seems neat, but I don’t really get why the author thinks processing the descriptor set is so hard. Seems equally difficult to learn a bunch of new abstractions in the form of tree-sitter vs just learning protobuf’s own ones.

Also, if you’re parsing .proto files directly, you have to deal with a bunch of annoying issues like include paths, how you package sets of them to move around, etc. descriptor sets seem like a better solution to me.

Re:Parsing Protobuf Definitions with Tree-sitter by kstrauser on Saturday August 03, 2024 @08:31PM (#41150290)
OTOH, if you can get treesitter to work, all the best editors will gain Protobuf support.
Re:Parsing Protobuf Definitions with Tree-sitter by oefrha on Sunday August 04, 2024 @05:53AM (#41152346)
No, they’re not inventing the tree-sitter grammar for protobuf here, they’re using the existing grammar provided by someone else. So it’s not like there’s additional reusable work being done here.
Re:Parsing Protobuf Definitions with Tree-sitter by parentheses on Saturday August 03, 2024 @11:33PM (#41151004)
Came to the comments to say this. FileDescriptors have been so simple to work with that I am so surprised the author is touting TS for this use case.

The other nice thing about all the descriptors is their schemas are protobufs, so language agnostic and easily serialized/deserialized.