I don’t think I am well positioned to answer that question given my experience. Ill give it my best.
I believe the advantage of more abstraction of gRPC was desireable because we can point it at a socket (Unix domain or internet sockets) and communicate across different domains. I think we are shooting for a “microserves” architecture but running it on one machine. FFI (IIRC) is more low level and more about language interoperability. gRPC would allow us to prototype stuff faster in other languages (like Python or go) and optimize to rust if it became a bottleneck.
Short answer is, we are able to deliver more value, quicker, to customers (I guess). But I don’t know much about FFI. Perhaps you can offer some reasons and use cases for it?
@varsock rust has very good code generation for C (and sometimes C++ as well) headers via bindgen (https://github.com/rust-lang/rust-bindgen). This allows you to potentially make minimal changes to the code without having to refactor to use a new protocol on the legacy side, and has faster performance (benchmark to confirm), since there’s no serialization/deserialization step. See https://doc.rust-lang.org/nomicon/ffi.html for how this is done manually.
@varsock @Timely_Jellyfish_2077 out of curiosity, why use grpc in lieu of ffi?
I don’t think I am well positioned to answer that question given my experience. Ill give it my best.
I believe the advantage of more abstraction of gRPC was desireable because we can point it at a socket (Unix domain or internet sockets) and communicate across different domains. I think we are shooting for a “microserves” architecture but running it on one machine. FFI (IIRC) is more low level and more about language interoperability. gRPC would allow us to prototype stuff faster in other languages (like Python or go) and optimize to rust if it became a bottleneck.
Short answer is, we are able to deliver more value, quicker, to customers (I guess). But I don’t know much about FFI. Perhaps you can offer some reasons and use cases for it?
@varsock rust has very good code generation for C (and sometimes C++ as well) headers via
bindgen
(https://github.com/rust-lang/rust-bindgen). This allows you to potentially make minimal changes to the code without having to refactor to use a new protocol on the legacy side, and has faster performance (benchmark to confirm), since there’s no serialization/deserialization step. See https://doc.rust-lang.org/nomicon/ffi.html for how this is done manually.@varsock If you plan to refactor the architecture to convert things into microservices, grpc is also a solid way to go.