Skip to content

Commit 70752d2

Browse files
committed
describe async vision doc RFC
1 parent 6513c2c commit 70752d2

File tree

1 file changed

+44
-34
lines changed

1 file changed

+44
-34
lines changed

src/2024h2/Async.md

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,65 +23,75 @@ We propose authoring an evaluation document exploring the options for standard R
2323

2424
### The status quo
2525

26-
Despite the growth of async Rust, it continues to be significantly more difficult to use. As one engineer from Amazon put it, Async Rust is "Rust on hard mode". Some of the key challenges to address are:
27-
28-
- Getting started:
29-
- **Good learning material is out there, but hard to find.** The lack of "standard" recommendations makes it [harder to direct people who are just getting started](https://rust-lang.github.io/wg-async/vision/submitted_stories/status_quo/niklaus_wants_to_share_knowledge.html).
30-
- **Fragmentation:** Every Rust async program must pick a runtime. Libraries that make use of non-trivial functionality must be written for one runtime. Combining runtimes sometimes works and sometimes doesn't, leading to [surprise failures when you try to run your program](https://rust-lang.github.io/wg-async/vision/submitted_stories/status_quo/alan_started_trusting_the_rust_compiler_but_then_async.html).
31-
- Getting your program to do what you want:
32-
- **Cancellation, `select!`, and other primitives considered harmful:** Many widely used APIs have sharp edges, such as [buffering issues](https://rust-lang.github.io/wg-async/vision/submitted_stories/status_quo/barbara_battles_buffered_streams.html), surprise cancellation, [difficult resource cleanup](https://rust-lang.github.io/wg-async/vision/submitted_stories/status_quo/alan_finds_database_drops_hard.html), etc.
33-
- **Cannot use references from inside tasks:** Spawning tasks are the solution to many of the above problems, but tasks cannot share references.
34-
- **Poll model scales poorly sometimes:** Complex futures like `FuturesUnordered` or joining a large number of tasks can have very poor performance because of the limits of the poll API.
35-
- Getting your program to run as fast as you want -- mostly works, but some challenges:
36-
- **Optimizing poll times is hard:**
37-
- **Future sizes are too big:**
26+
Despite the growth of async Rust, it continues to be significantly more difficult to use. As one engineer from Amazon put it, Async Rust is "Rust on hard mode". Addressing these challenges from the Rust org has been challenging due to lack of coherence around a vision and clear steps. Discussion gets stuck not only on technical details but also on what problems to be resolving first. The lack of a centrally agreed upon vision has also made it hard for general purpose teams such as [Lang][] or [Libs-API][] to decide how to respond to requests to e.g. stabilize particular async-related constructs, as they lack a means to judge whether stabilizing any particular construct is really the right step forward and whether it meets its design needs.
3827

3928
### Our plan for 2024
4029

41-
Author an RFC that will lay out a vision for the Async Rust experience:
30+
We plan to revise the Async Vision Doc and restructure it as an RFC. This RFC will lay out a "plan of attack" for async, including both obvious good things (similar to [async closures][]) but also "known unknowns" and ways to resolve them. A rough outline of the RFC may be as follows:
4231

43-
* What works well and what challenges exist in the Status Quo of Async Rust
44-
* Long-term goals (e.g., over next 3-5 years) for async Rust
45-
* Free of accidental complexity
46-
*
47-
* Problems we need to solve to achieve those goals along with possible solutions
48-
*
32+
[Making Async Rust Reliable]: https://tmandry.gitlab.io/blog/posts/making-async-reliable/
4933

34+
* Status quo, covering biggest challenges
35+
* Lack of strong learning material
36+
* Common idioms contain footguns that cause unexpected failures (see e.g., Tyler's blog post [Making Async Rust Reliable][])
37+
* Low-level performance hurdles, such as large future sizes and downsides of the poll model
38+
* Fragmentation between runtimes
39+
* Design axioms to pursue for async (see e.g. axioms proposed)
40+
* Goals, some variant of
41+
* Free of accidental complexity
42+
* Easy to get started
43+
* Easy to pick executor and integrate with other systems (e.g., mobile runtimes, company-specific threadpools, etc)
44+
* Moderately easy to adapt to "extreme" embedded environments
45+
* Good performance by default, peak performance with tuning
46+
* Key unknowns in terms of how to achieve the above goals, for example
47+
* how to replace footgun-prone APIs with more reliable alternatives:
48+
* buffered-streams, cancellation (esp. due to use of select)
49+
* patterns to express
50+
* merged streams -- processing one stream of data with occasional control events
51+
* task parallelism
52+
* cleanup and teardown
53+
* ordered destruction
54+
* how should async drop work (`?Leak` vs `?Drop` vs whatever):
55+
* how to prevent async drop from occuring in sync contexts?
56+
* what does runtime interface look like?
57+
* Can/should we be generic over runtime
58+
* Strategy for how to get where we are going
59+
* What problems to attack first
60+
* How to reduce or find solutions to the above unknowns
5061

5162
### Looking further out
5263

53-
Our overall vision for async is that using async Rust should feel very similar to sync Rust, but with extra superpowers. The standard library should offer interop traits as well as traits for doing structured concurrency, similar to what is found in Kotlin. Standing up a simple service should use some executor to implement this functionality by default, but it should be easy to change, and most of the standard library support should work just as well in embedded environments as it does in multicore server setups.
64+
Our overall vision for async is that using async Rust should feel very similar to sync Rust, but with extra superpowers.
5465

55-
## Design axioms
66+
## Design axiom
5667

57-
* **We lay the foundations for a thriving ecosystem.**
58-
* **Uphold sync's Rust bar for reliability.**
59-
* **Zero-cost.**
60-
* **From embedded to the cloud.**
61-
* **Consistent, incremental progress.**
68+
* **We lay the foundations for a thriving ecosystem.** In the Rust org, our role is to focus on the rudiments that support an interoperable and thriving async crates.io ecosystem.
69+
* **Uphold sync's Rust bar for reliability.** Sync Rust famously delivers on the general feeling of "if it compiles, in works" -- async Rust should do the same.
70+
* **Zero-cost, guided by performance.** People adopt async Rust because they know it can deliver them both high reliability *and* peak performance. As we build out our designs, we want to ensure that they don't introduce an "abstraction tax" for using them.
71+
* **From embedded to GUI to the cloud.** Async Rust covers a wide variety of use cases and we aim to make designs that can span those differing constraints with ease.
72+
* **Consistent, incremental progress.** People are building async Rust systems *today* -- we need to ship incremental improvements while also steering towards the overall outcome we want.
6273

6374
## Ownership and other resources
6475

65-
**Owner:** tmandry
76+
**Owner:** [tmandry][]
6677

67-
XXXX
78+
[tmandry]: https://github.com/tmandry
6879

6980
### Support needed from the project
7081

71-
_Identify which teams you need support from -- ideally reference the "menu" of support those teams provide. Some common considerations:_
82+
From [Lang] and [Libs-API][], agreement to review RFC (and drafts of RFC) and provide feedback, as well as agreement on using this process as the way to chart our async story.
7283

7384
## Outputs and milestones
7485

7586
### Outputs
7687

77-
_Final outputs that will be produced_
88+
An RFC for the Rust async vision doc.
7889

7990
### Milestones
8091

81-
_Milestones you will reach along the way_
92+
* First draft document
93+
* RFC opened
8294

8395
## Frequently asked questions
8496

85-
### What do I do with this space?
86-
87-
_This is a good place to elaborate on your reasoning above -- for example, why did you put the design axioms in the order that you did? It's also a good place to put the answers to any questions that come up during discussion. The expectation is that this FAQ section will grow as the goal is discussed and eventually should contain a complete summary of the points raised along the way._
97+
None.

0 commit comments

Comments
 (0)