mransan / ocaml-protoc

A Protobuf Compiler for OCaml
https://mransan.github.io/ocaml-protoc/
MIT License
179 stars 33 forks source link

Support service syntax #126

Closed Leonidas-from-XIV closed 4 years ago

Leonidas-from-XIV commented 6 years ago

I am not sure what it would compile to, but I think it would be nice if the parser at least processed it and showed syntax errors and then exited with a (disableable) error. Currently I have to comment out these sections from the .proto files, which is not terrible but it would be nice if I could just use the proto files as-is.

mransan commented 5 years ago

I guess I could just allow parsing of the file but not generate anything.

carlosdagos commented 4 years ago

:+1:

I'm looking to try out: https://github.com/etcd-io/etcd/blob/master/etcdserver/etcdserverpb/rpc.proto -- it uses the service syntax quite heavily. I'm not sure what the expected output would be here, but would be nice. Thanks!

mransan commented 4 years ago

Since that file only contains the service definition. I think it might be best to rather run ocaml-protoc on each of the included file to generate the type.

ocaml-protoc is solely focusing on the serialization part not the IPC part.

c-cube commented 4 years ago

could service files produce a functor that is parametrized by, say, a state type, and containing a state machine for query/replies? Then the user can instantiate that with the appropriate transport (such as http2, but not limited to that)?