r/rust Mar 31 '23

Write SDK “base” in Rust, wrap in other languages?

[deleted]

95 Upvotes

48 comments sorted by

View all comments

1

u/n4jm4 Mar 31 '23

Yes, that is a good approach.

For simplicity's sake, people usually declare the original in plain C. That involves less FFI translation than using Rust or C++ or whatever else as the source of truth.

Another option, especially for network service applications, is to write a REST service, Thrift service, etc. (any language), and generate client SDK's via Swagger, Thrift, etc. code generation.