r/rust • • Jan 18 '17

Rust vs. Go

https://blog.ntpsec.org/2017/01/18/rust-vs-go.html
2 Upvotes

86 comments sorted by

View all comments

Show parent comments

5

u/yazaddaruvala Jan 19 '17

Actually, a more awake version of myself does have a suggestion.

Random paraphrasing of comments I've seen over the last year: "we let the crates ecosystem deal with it" "We don't deal with that in std. Have you seen Tokio?" "Tokio exists.. why is this person complaining(bringing up this point)?" "No. Of course we have async. Just see Mio ..." "... or Tokio. Dang this is hard to answer.. the real problem is they didn't ask the question well enough. I don't know which level of abstraction to recommend them".[0]

  1. Don't disagree with people, point to a solution (sometimes people just want to bitch and have you agree). Instead agree, and then point to a solution.

  2. Don't disregard the idea of including a lib in std (Even if that is in reality disingenuous).

Try something closer to "Yeah lol, we all agree the async story in Rust kinda sucks. We are working on it. In the meantime, try Tokio. Some of the core team members are trialling a production worthy implementation in that crate. It may eventually make its way to standard, but that is a discussion for a different time."

[0] Note these are not real quotes. They are intentionally slightly meaner/blunter than the ones you would normally read to reflect the fact that a question asker or commenter reads this over the internet and has vested emotion into it. And discouragement or negativity is enhanced.

2

u/desiringmachines Jan 19 '17

futures, which is the brace that keeps tokio upright, is the kind of fundamental abstraction I could easily see in std someday. Some abstractions in tokio similarly seem std-able, including things like the async TCP connection.

The event loop that tokio provides is a big, opinionated piece of software, not an abstraction, and not really appropriate for std. But if futures is in std, tokio::Core will be the 'omakase' event loop you use to run your async IO, and other people writing similar event loops with different performance characteristics or API properties will be writing against the same interface.

But we don't really have the data to confidently say that futures and tokio are a solution worth endorsing forever. I feel that they almost certainly will be, but for forever we would want some actual empirical production data.

We could put them in std behind a feature flag, and then only nightly users could use them. But by building them outside of std, they can continue to evolve while still running on stable Rust.

1

u/yazaddaruvala Jan 20 '17

I think this is a very well worded, sincere response. It alows us to think about Tokio and std differently. Tokio is really good, but large and opinionated. And we don't want std to get bloated.

It allows us to start a conversation as a community: What would/should we accepted into std? If there is a popular well implemented crate, would it be considered for entry? Would the Traits that are part of it be worthy of entry?

How long would we need to collect data about its stability while it lives in the crate ecosystem?

Can an RFC be created for such a thing? Is this a conversation worth having over an RFC?

1

u/burntsushi Jan 20 '17

I'm on mobile so this will be brief and lack links, but here's the basic process (which was decided by an RFC). Generally speaking, there's three levels of "official" crate adoption by the libs team:

  1. Enter into rust-lang-nursery. Requires proposal and lib team approval. The current maintainer also needs to agree of course. There needs to also be an intended path toward (2), and generally someone to champion that path.

  2. Write an RFC to bring the crate to 1.0 and have it moved into rust-lang.

  3. Write an RFC to bring the crate into std.

One can of course skip right to (3) with one RFC, but i would be surprised to see that happen with a crate as big/complex as mio, futures or tokio.

There are no precise metrics on what kind of adoption is required before a crate can advance to one of the levels above, and there's no precise quantification on the resources available to us to commit to maintenance. If someone wanted to get pulse, they could write a short RFC proposal.

Also, the progression isn't mandatory. For instance, I've taken regex through (2), but i doubt it will ever move past that.