-
From the docs "The protocol compiler can output a FileDescriptorSet containing the .proto files it parses." (https://github.com/protocolbuffers/protobuf/blob/main/src/go...)
I don't understand the point of using tree-sitter to repeat that work (almost certainly having bugs doing so). Am I missing something?
-
InfluxDB
Purpose built for real-time analytics at any scale. InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.
-
I need to get around to playing with tree-sitter. The approach in this article is neat.
Here's another approach. The AST of a .proto file is itself a protobuf. That's how the codegen plugins work. Protobuf also has a canonical mapping to JSON, so...
What you can do is use protoc to parse the .proto file, spit it out as JSON, and then process that data using your favorite pattern matching language. I wrote a [tool][1] that helps with that. For example, here's some [js code][2] that translates protobuf message definitions into "types" for use in an ORM.
[1]: https://github.com/dgoffredo/protojson
-
-
truss
Truss helps you build go-kit microservices without having to worry about writing or maintaining boilerplate code.
I found that some parts of a protobuf aren't captured well by protoc; specifically annotations were not well exposed to Go libraries for writing protoc plugins in 2016. I ended up having to write my own basic protobuf parser to reliably extract annotations and comments for code and documentation generation:
https://github.com/metaverse/truss/blame/master/svcdef/svcde...
-
I used to write proto parser using ragel <https://github.com/adrian-thurston/ragel> for work way back as well, it was surprisingly painless. Think this was way back when protobuf was transitioning to proto3.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives