Project

General

Profile

Feature #21785

Add Rust as a supported language

Added by Richard Neswold 8 months ago. Updated 6 months ago.

Status:
Feedback
Priority:
Normal
Category:
Rust generator
Target version:
Start date:
01/29/2019
Due date:
% Done:

0%

Estimated time:
Duration:

Description

There is some interest to have Rust be a supported target language of the protocol compiler. This issue will track the efforts adding it.

History

#1 Updated by Richard Neswold 8 months ago

I've added some notes about mapping to Rust: Rust Generator.

#2 Updated by Richard Neswold 7 months ago

  • Target version set to Protocol Compiler v1.2
  • Status changed from New to Closed

Added: 66acdb6a

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 7 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 async/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!

#4 Updated by Richard Neswold 6 months ago

  • Tracker changed from Support to Feature


Also available in: Atom PDF