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

create haskell data from .proto message files (and vice versa) #9

Open
ghorn opened this issue May 16, 2014 · 3 comments
Open

create haskell data from .proto message files (and vice versa) #9

ghorn opened this issue May 16, 2014 · 3 comments

Comments

@ghorn
Copy link

ghorn commented May 16, 2014

The documentation mentions this is in the works already. It would be nice to have this, especially since the hprotoc project seems to be broken on ghc 7.8

@NathanHowell
Copy link
Member

I disabled protoc-gen-hs in recent builds because it doesn't produce working output and it has a dependency on a pretty heavyweight library: haskell-src-exts. It would be great to get something that does work and uses explicit layout or a light weight pretty printer.

There is also a stub of a .proto generator that needs some love:
src/Data/ProtocolBuffers/Ppr.hs. It was built against type-level and has experienced some bitrot since the 7.8 conversion. This should be significantly easier to get working than the Haskell codgen.

If you want to take a stab at either one I'm more than happy to accept pull requests.

@YellowOnion
Copy link

In the meantime, is there anyway to manually convert .proto to work with this library.

@NathanHowell
Copy link
Member

@YellowOnion yes, you can manually translate messages in a .proto file into their protobuf equivalent records in Haskell... for example most of the records in https://github.com/alphaHeavy/protobuf/blob/master/plugin/Main.hs were translated from https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto

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

3 participants