GRPC and Ruby, Proto language level 2

111 views
Skip to first unread message

Josh Humphries

unread,
Jan 8, 2016, 6:17:07 PM1/8/16
to grpc-io, prot...@googlegroups.com
I am actively pursuing moving a proprietary RPC mechanism to GRPC. And the languages currently needed are Ruby, Go, and Java.

I didn't realize before trying a few things today that the newly added languages/platforms in proto3 (e.g. Ruby) cannot generate code via protoc for language level 2. This looks like it could be a serious blocker for what I and my team want to do.

Is this stance, to not support language level 2, a hard stance? We cannot (nor do we even want to) move all of our protos to language level 3. We use extensions.

If we wanted to contribute a patch to protoc to support language level 2 in Ruby, would it be accepted?

We could likely make due with the changes in semantics for default values and unknown fields/enum values. So we could just run the existing language-level-3 code-gen against language level 2 source files. But we'd need to implement some mechanism to support extensions.

If such a patch would never be accepted, would it be feasible for us to use a 3rd party proto gem for Ruby with GRPC? I'm quite familiar with the Java implementation of GRPC and know that it has a layer that is independent from protos (which, in Java, enables the use of Nano instead of the standard Java runtime). This could be used to support different mechanisms for marshalling data, including even alternate IDLs and formats (thrift, JSON, etc).

Is the C implementation (and Ruby bindings) architected this way, too? If so, it seems like it should be possible to graft non-protoc generated protos onto GRPC.

----
Josh Humphries
Manager, Shared Systems  |  Platform Engineering
Atlanta, GA  |  678-400-4867

Tim Emiola

unread,
Jan 8, 2016, 6:45:46 PM1/8/16
to Josh Humphries, grpc-io, prot...@googlegroups.com
Hi Josh,

I'll leave someone from the protobuf team to comment on the patch, but the grpc ruby-bindings are architected in the way you expect.  E.g, before protobuf ruby was released, it used protoc with a patched version of beefcake to create stubs and skeletons.
 

----
Josh Humphries
Manager, Shared Systems  |  Platform Engineering
Atlanta, GA  |  678-400-4867

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CAHJZN-vup2mC2Hk5XkocRN1JXr1dFD3ELh4FQE95OJso8f9xoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
This email may be confidential or privileged.  If you received this communication by mistake, please don't forward it to anyone else (it may contain confidential or privileged information), please erase all copies of it, including all attachments, and please let the sender know it went to the wrong person. Thanks.

Josh Haberman

unread,
Jan 10, 2016, 5:44:52 PM1/10/16
to Protocol Buffers, grp...@googlegroups.com
Hi Josh,


On Friday, January 8, 2016 at 3:17:11 PM UTC-8, Josh Humphries wrote:
I am actively pursuing moving a proprietary RPC mechanism to GRPC. And the languages currently needed are Ruby, Go, and Java.

I didn't realize before trying a few things today that the newly added languages/platforms in proto3 (e.g. Ruby) cannot generate code via protoc for language level 2. This looks like it could be a serious blocker for what I and my team want to do.

Is this stance, to not support language level 2, a hard stance? We cannot (nor do we even want to) move all of our protos to language level 3. We use extensions.

If we wanted to contribute a patch to protoc to support language level 2 in Ruby, would it be accepted?

Yes most definitely! We have wanted to add this for a while, we just hadn't gotten to it yet.

This would involve (as you say):

- augmenting the schema DSL so you can define proto2 types in addition to proto3 ones.
- adding field presence for proto2 primitive types (with hasbits)
- implementing proto2 enum semantics
- adding extension support

I would love to talk over what the implementation would look like on this. If you're down, we can talk more details.

Thanks,
Josh

Eric Zundel Ayers

unread,
Jan 12, 2016, 7:06:09 AM1/12/16
to grpc.io, prot...@googlegroups.com, habe...@google.com
Hi Josh (Haberman),

Do you have any pointers for us in the patches for the beefcake gem?  We were hoping we might be able to use that with our development while we worked on the protoc patches.  

We tried using the stock beefcake gem and didn't get very far with our internal proto definitions.   The README for the current open source version says that it doesn't support imports, which is a pretty fundamental restriction!  

-Eric.

Tim Emiola

unread,
Jan 15, 2016, 11:49:28 AM1/15/16
to grpc.io, prot...@googlegroups.com, habe...@google.com
Hi Eric,

We never actually published it - I'll clean up the patch I was using and push it to a branch on my github fork of beefcake.  Will that do ?

Tim

Josh Humphries

unread,
Jan 15, 2016, 12:05:20 PM1/15/16
to Tim Emiola, grpc.io, prot...@googlegroups.com, habe...@google.com
I think that would be great. Thanks, Tim!

----
Josh Humphries
Manager, Shared Systems  |  Platform Engineering
Atlanta, GA  |  678-400-4867

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.

To post to this group, send email to grp...@googlegroups.com.

Eric Zundel Ayers

unread,
Jan 15, 2016, 12:16:20 PM1/15/16
to Josh Humphries, Tim Emiola, grpc.io, prot...@googlegroups.com, habe...@google.com
Reply all
Reply to author
Forward
0 new messages