bugout-dev / locust

"git diff" over abstract syntax trees
MIT License
50 stars 7 forks source link

Create proto definitions for Locust data structures #37

Closed zomglings closed 3 years ago

zomglings commented 3 years ago

The Javascript plugin duplicates the data structure definitions (PatchInfo, HunkInfo, RawDefinition, LocustChange, etc.) from the core Python library.

The fact that each plugin has to define its own data structures creates two kinds of issues:

  1. Plugins can very easily go out of date in terms of their input and output interfaces
  2. It is easy to make mistakes when defining a data structure that sits at a plugin boundary

Protobufs are a great way to give plugins a consistent interface to program against. We can define all of the core Locust data types as proto files and generate data structures for each language using protoc.

More documentation on protobuf: https://github.com/protocolbuffers/protobuf