Protobuf: Rust Generated Code Guide

79 points quxfoo 19 comments

Just stumbled upon this and I am not sure I like what I see. Unidiomatic, cumbersome and a huge step back from prost. And all that for weak reasons. Among others:

The biggest factor that goes into this decision was to enable zero-cost of adding Rust to a preexisting binary which already uses non-Rust Protobuf. By enabling the implementation to be ABI-compatible with the C++ Protobuf generated code, it is possible to share Protobuf messages across the language boundary (FFI) as plain pointers, avoiding the need to serialize in one language, pass the byte array across the boundary, and deserialize in the other language.

I had my fair share of problems linking two components using C++ gRPC into the same binary causing both compile and runtime problems. I don't wanna know what tonic will look like.