Add Rust as a supported language
There is some interest to have Rust be a supported target language of the protocol compiler. This issue will track the efforts adding it.
#2 Updated by Richard Neswold 12 months ago
- Target version set to Protocol Compiler v1.2
- Status changed from New to Closed
This is a preliminary implementation; I fully expect further changes to the API as Rust users find deficiencies in the code. I encourage Rust programmers to look at the generated code and recommend changes to the API which improve correctness and to offer optimization suggestions.
#3 Updated by Richard Neswold 11 months ago
- Status changed from Closed to Feedback
Re-opening for feedback.
After some more reading and research into Rust, it seems the crate that provides the official, asynchronous API is
tokio. If/when we develop an ACNET crate, it'll probably be based on this API. The
tokio crate has lots of useful, asynchronous constructs including traits for encoding and decoding protocols! I think it may be a good idea to retool the protocol compiler's Rust support to use these traits. My only hesitation is doing this would make Rust the first language dependent on a third-party library1. Installing third-party crates is insanely easy (at least on my Mac), so it doesn't seem like this is too much of a hardship. Plus, there's talk the
tokio implementation might become the
await core for Rust which means, in the future2, we won't be using a third-party crate.
Any thoughts, Brian?
1 We do have a GWT generator, but it's a specialization of the Java generator. The generic Java generator doesn't have any third-party dependencies.
2 But I don't wait to
await on that
Future. Ha! A Rust joke!