Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse proto files #30

Closed
5 tasks
pepegar opened this issue Nov 21, 2018 · 2 comments
Closed
5 tasks

Parse proto files #30

pepegar opened this issue Nov 21, 2018 · 2 comments
Assignees

Comments

@pepegar
Copy link
Member

pepegar commented Nov 21, 2018

It would be great to have a way to parse protocol buffers in
Skeuomorph!

This task would involve several smaller tasks to be completed (we can
address each one in a separate PR if we like):

  • compile the proto file into its binary format
  • get a FileDescriptorProto out of it
  • convert all message declarations into ProtobufF declarations.
  • create a protocol describing a Protobuf file.
  • create transformation between Protobuf's protocol and Mu's
    protocol.

Compile proto file

To do this we can use protoc-jar as a library.

Convert proto bytes into a FileDescriptorProto

FileDescriptorProto comes from protobuf-java library, the oficial
SDK for protobuf in Java. The idea would be to use
FileDescriptorProto.parseFrom to convert from the bytes generated
with protoc compilation into something with more semantics, like a
FileDescriptorProto.

Convert message declarations to ProtobufF

This is done with a Droste's Coalgebra, and the process would be
similar to the one we are doing for avro here.

Create a skeuomorph.protobuf.Protocol

This should be similar to Avro's.

Conversion Protobuf -> Mu

This should be similar to Mu's fromAvroProtocol

Thanks @AdrianRaFo for https://github.com/AdrianRaFo/proton, from which I pulled the inspiration to create this issue a la skeuomorph

@AdrianRaFo
Copy link

AdrianRaFo commented Nov 21, 2018

Proton uses sbt-protoc and scalapb behind the scenes to read the proto file so it can be helpful to discover how to proceed in some cases.
Thank you @pepegar

@juanpedromoreno
Copy link
Member

This has been completed by #66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants