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

gRPC for c (not cpp) #23160

Closed
lioriz opened this issue Jun 8, 2020 · 7 comments
Closed

gRPC for c (not cpp) #23160

lioriz opened this issue Jun 8, 2020 · 7 comments

Comments

@lioriz
Copy link

lioriz commented Jun 8, 2020

Hi,
I'm i have server/client written in c.
I don't see any support for c, only cpp.

@gnossen
Copy link
Contributor

gnossen commented Jun 8, 2020

Juniper has written gRPC C bindings that you may be interested in. (though it looks like they haven't been updated in a while)

@lioriz
Copy link
Author

lioriz commented Jun 9, 2020

I seen Juniper Project, it haven't been updated since May 2018.
I can't rely on it in my project.
For now the best solutions i can think of is to convert my code to CPP or to wrap gRPC-C++ in C code myself.

@markdroth
Copy link
Member

We've talked about doing this several times, but it's never been a high enough priority to actually make it happen. And unfortunately, I don't see this changing any time soon. If you want to contribute something, feel free to start by putting together a gRFC for a C API.

Sorry that we can't be of more help.

@lioriz
Copy link
Author

lioriz commented Jun 18, 2020

We've talked about doing this several times, but it's never been a high enough priority to actually make it happen. And unfortunately, I don't see this changing any time soon. If you want to contribute something, feel free to start by putting together a gRFC for a C API.

Sorry that we can't be of more help.

Hi
Will be happy to contribute gRPC C API.
How can I start?

@markdroth
Copy link
Member

This would be a pretty significant undertaking. You'd have to write a gRFC proposing the C API, go through the review process for that, and then implement the whole C API. If you want to use this with protobuf, you would probably also need to write a protobuf compiler plugin to generate a C protobuf API (or maybe use something like upb for that).

@lioriz
Copy link
Author

lioriz commented Jun 18, 2020

I would like to take part of something like that.
where do you think it would be best to start?
protobuf or gRPC?

@markdroth
Copy link
Member

I don't think the protobuf folks are interested in providing a C API, but there are libraries like upb that have a C API. Unfortunately, upb does not yet offer a stable API, but you could talk to @haberman about when that might happen. Alternatively, if all you need is a C API (i.e., it's okay for the underlying implementation to still be C++, which I assume is true if you're able to use a C wrapper around gRPC, since it's also written in C++), then you might be able to write a protobuf compiler plugin to generate that. I'm not sure whether or not that would be sufficient, but you'd probably need to do one of those two things if you want to use protobuf via a C API.

Separately from that, you will need to write a gRFC to design the gRPC C API. The gRPC API should be independent of protobuf, because it should be able to work with any IDL, just like the gRPC API in other languages.

These two pieces are more or less independent, so I don't think it matters where you start.

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

No branches or pull requests

4 participants