Skip to content

Commit 0770901

Browse files
authored
Merge pull request #27 from nikomatsakis/vision-document-pr
second draft of vision doc process
2 parents 3727be1 + 4057c19 commit 0770901

39 files changed

+760
-112
lines changed

rfc-drafts/stream.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ trait Stream {
247247

248248
Unfortunately, async methods in traits are not currently supported,
249249
and there [are a number of challenges to be
250-
resolved](https://rust-lang.github.io/wg-async-foundations/design_notes/async_fn_in_traits.html)
250+
resolved](https://rust-lang.github.io/wg-async-foundations/design_docs/async_fn_in_traits.html)
251251
before they can be added.
252252

253253
Moreover, it is not clear yet how to make traits that contain async
@@ -309,7 +309,7 @@ design issues] to be resolved before they are added. Therefore, we've
309309
decided to enable progress on the stream trait by stabilizing a core,
310310
and to come back to the problem of extending it with combinators.
311311

312-
[outstanding design issues]: https://rust-lang.github.io/wg-async-foundations/design_notes/async_closures.html
312+
[outstanding design issues]: https://rust-lang.github.io/wg-async-foundations/design_docs/async_closures.html
313313

314314
This path does carry some risk. Adding combinator methods can cause
315315
existing code to stop compiling due to the ambiguities in method

src/SUMMARY.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
# Summary
22

3-
- [Welcome](./welcome.md)
4-
- [Design notes](./design_notes.md)
5-
- [Yield-safe lint](./design_notes/yield_safe.md)
6-
- [Stream trait](./design_notes/stream.md)
7-
- [Generator syntax](./design_notes/generator_syntax.md)
8-
- [AsyncRead, AsyncWrite traits](./design_notes/async_read_write.md)
9-
- [Async fn in traits](./design_notes/async_fn_in_traits.md)
10-
- [Mutex (future-aware)](./design_notes/mutex.md)
11-
- [Async aware channels](./design_notes/channels.md)
12-
- [Async closures](./design_notes/async_closures.md)
13-
- [Join combinator](./design_notes/join.md)
14-
- [Select combinator](./design_notes/select.md)
15-
- [Sink trait](./design_notes/sink_trait.md)
16-
- [Async main](./design_notes/async_main.md)
17-
- [Async drop](./design_notes/async_drop.md)
18-
- [Async lifecycle](./design_notes/async_lifecycle.md)
19-
- [Completion-based futures](./design_notes/completion_based_futures.md)
20-
3+
- [👋🏽 Welcome](./welcome.md)
4+
- [🔮 The vision](./vision.md)
5+
- [✏️ Design tenets for async](./vision/tenets.md)
6+
- [🙋‍♀️ Cast of characters](./vision/characters.md)
7+
- [😱 Status quo](./vision/status_quo.md)
8+
- [✨ Shiny future](./vision/shiny_future.md)
9+
- [📅 Roadmap for 2021](./vision/roadmap.md)
10+
- [❓How to vision doc](./vision/how_to_vision_doc.md)
11+
- [🔍 Triage meetings](./triage.md)
12+
- [🔬 Design docs](./design_docs.md)
13+
- [⚠️ Yield-safe lint](./design_docs/yield_safe.md)
14+
- [☔ Stream trait](./design_docs/stream.md)
15+
- [⚡ Generator syntax](./design_docs/generator_syntax.md)
16+
- [📝 AsyncRead, AsyncWrite traits](./design_docs/async_read_write.md)
17+
- [🧬 Async fn in traits](./design_docs/async_fn_in_traits.md)
18+
- [🔒 Mutex (future-aware)](./design_docs/mutex.md)
19+
- [📺 Async aware channels](./design_docs/channels.md)
20+
- [📦 Async closures](./design_docs/async_closures.md)
21+
- [🤝 Join combinator](./design_docs/join.md)
22+
- [🤷‍♀️ Select combinator](./design_docs/select.md)
23+
- [🚰 Sink trait](./design_docs/sink_trait.md)
24+
- [🎇 Async main](./design_docs/async_main.md)
25+
- [🗑️ Async drop](./design_docs/async_drop.md)
26+
- [♻️ Async lifecycle](./design_docs/async_lifecycle.md)
27+
- [⏳ Completion-based futures](./design_docs/completion_based_futures.md)
28+
- [💬 Conversations](./conversations.md)
29+
- [🐦 2021-02-12 Twitter thread](./conversations/2021-02-12-Twitter-Thread.md)

src/conversations.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# 💬 Conversations
2+
3+
This section contains notes and summaries from conversations that we have had with people are using Rust and async and describing their experiences. These conversations and links are used as "evidence" when building [the "status quo" section][sq].
4+
5+
[sq]: vision/status_quo.md
6+
7+
## Not exhaustive nor mandatory
8+
9+
This section is not meant to be an "exhaustive list" of all sources. That would be impossible. Many conversations are short, not recorded, and hard to summaize. Others are subject to NDA. We certainly don't require that all claims in the [status quo][sq] section are backed by evidence found here. Still, it's useful to have a place to dump notes and things for future reference.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# 🐦 2021-02-12 Twitter thread
2+
3+
Notes taken from the thread in response to [Niko's tweet](https://twitter.com/nikomatsakis/status/1359454255971770372).
4+
5+
* [Enzo](https://twitter.com/enzo_mdd/status/1359544617121820676)
6+
* A default event loop. "choosing your own event loop" takes time, then you have to understand the differences between each event loop etc.
7+
* Standard way of doing `for await (variable of iterable)` would be nice.
8+
* Standard promise combinators.
9+
* [creepy_owlet](https://twitter.com/creepy_owlet/status/1359649695103131649)
10+
* https://github.com/dtantsur/rust-osauth/blob/master/src/sync.rs
11+
* async trait --
12+
* https://twitter.com/jcsp_tweets/status/1359820431151267843
13+
* "I thought async was built-in"?
14+
* nasty compiler errors
15+
* [ownership puzzle](https://www.fpcomplete.com/blog/ownership-puzzle-rust-async-hyper/) blog post
16+
* [rubdos](https://twitter.com/rubdos/status/1359462402702606336)
17+
* [blog post](https://www.rubdos.be/corona/qt/rust/tokio/actix/2020/05/23/actix-qt.html) describes integrating two event loops
18+
* mentions desire for runtime independent libraries
19+
* qt provides a mechanism to integrate one's own event loop
20+
* [llvm bug](https://github.com/rust-lang/rust/issues/60605) generates invalid arm7 assembly
21+
* [alexmiberry](https://twitter.com/alexmiberry/status/1359559299161325581)
22+
* kotlin/scala code, blocked by absence of async trait
23+
* helpful blog post
24+
* [jamesmcm](http://jamesmcm.github.io/blog/2020/05/06/a-practical-introduction-to-async-programming-in-rust/)
25+
* note that `join` and `Result` play poorly together
26+
* [async-std version](https://github.com/jamesmcm/async-rust-example/blob/async-std/client_async/src/main.rs#L50-L59)
27+
* [tokio version](https://github.com/jamesmcm/async-rust-example/blob/master/client_async/src/main.rs#L40-L61) has some wild "double question marks" -- I guess that spawn must be adding a layer of `Result`?
28+
* the post mentions rayon but this isn't really a case where one ought to use rayon -- still, Rayon's APIs here are SO much nicer :)
29+
* [rust aws and lambda](http://jamesmcm.github.io/blog/2020/04/19/data-engineering-with-rust-and-aws-lambda/#en)
30+
* [issue requiring async drop](https://github.com/jamesmcm/s3rename/issues/16)
31+
* [fasterthanlime](https://fasterthanli.me/articles/getting-in-and-out-of-trouble-with-rust-futures) --
32+
* this post is amazing
33+
* the discussion on Send bounds and the ways to debug it is great
34+
* [bridging different runtimes using GATs](https://github.com/thanethomson/async-channel-abs/blob/master/src/runtime.rs)
35+
* first server app, [great thread with problems](https://twitter.com/richardsabow/status/1345815109201842178)
36+
* "I wasn't expecting that it will be easy but after Go and Node.js development it felt extremely hard to start off anything with Rust."
37+
* "felt like I have to re-learn everything from scratch: structuring project and modules, dependency injection, managing the DB and of course dealing with concurrency"
38+
* common thread: poor docs, though only somewhat in async libraries
39+
* I had enums in the DB and it was a bit more complex to map them to my custom Rust enums but I succeeded with the help of a couple of blog posts – and not with Diesel documentation
40+
* I used Rusoto for dealing with AWS services. It's also pretty straightforward and high quality package – but again the documentation was sooo poor.
41+
* [implaustin](https://t.co/4rlyfUlFES?amp=1) wrote a [very nice post](https://t.co/4rlyfUlFES?amp=1) but it felt more like a "look how well this worked" post than one with actionable feedback
42+
* "Async has worked well so far. My top wishlist items are Sink and Stream traits in std. It's quite difficult to abstract over types that asynchronously produce or consume values."
43+
* "AsyncRead/AsyncWrite work fine for files, tcp streams, etc. But once you are past I/O and want to pass around structs, Sink and Stream are needed. One example of fragmentation is that Tokio channels used to implement the futures Sink/Stream traits, but no longer do in 1.0."
44+
* "I usually use Sink/Stream to abstract over different async channel types. Sometimes to hide the details of external dependencies from a task (e.g. where is this data going?). And sometimes to write common utility methods."
45+
* "One thing I can think of: there are still a lot of popular libraries that don't have async support (or are just getting there). Rocket, Criterion, Crossterm's execute, etc."
46+
* [EchoRior](https://twitter.com/EchoRior/status/1359964691305496579):
47+
* "I've written a bit of rust before, but rust is my first introduction to Async. My main gripes are that it's hard to figure our what the "blessed" way of doing async is. I'd love to see async included in the book, but I understand that async is still evolving too much for that."
48+
* "Adding to the confusion: theres multiple executors, and they have a bit of lock in. Async libraries being dependent on which executor version I use is also confusing for newcomers. In other langs, it seems like one just uses everything from the stdlib and everything is compatible"
49+
* "That kind of gave me a lot of hesitation/fomo in the beginning, because it felt like I had to make some big choices around my tech stack that I felt I would be stuck with later. I ended up chatting about this in the discord & researching for multiple days before getting started."
50+
* "Also, due to there not being a "blessed" approach, I don't know if I'm working with some misconceptions around async in rust, and will end up discovering I will need to redo large parts of what I wrote."

src/design_docs.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# 🔬 Design documents
2+
3+
The **design documents** (or "design docs", more commonly) describe potential designs. These docs vary greatly in terms of their readiness to be implemented:
4+
5+
* Early on, they describe a vague idea for a future. Often this takes the shape of capturing constraints on the solution, rather than the solution itself.
6+
* When a feature is getting ready to ship, they can evolve into a full blown RFC, with links to tracking issues or other notes.
7+
8+
## Early stage design docs
9+
10+
In the early stages, design docs are meant to capture interesting bits of "async design space". They are often updated to capture the results of a fruitful conversation or thread which uncovered contraints or challenges in solving a particular problem. They will capture a combination of the following:
11+
12+
* use cases;
13+
* interesting aspects to the design;
14+
* alternatives;
15+
* interactions with other features.
16+
17+
## Late stage design docs
18+
19+
As a design progresses, the doc should get more and more complete, until it becomes something akin to an RFC. (Often, at that point, we will expand the design document into a directory, adding an actual RFC draft and other contents; those things can live in this repo or elsewhere, depending.) Once we decide to put a design doc onto the roadmap, it will also contain links to tracking issues or other places to track the status.

src/design_docs/async_closures.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# 📦 Async closures

src/design_docs/async_drop.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# 🗑️ Async drop

src/design_notes/async_fn_in_traits.md renamed to src/design_docs/async_fn_in_traits.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Async fn in traits
1+
# 🧬 Async fn in traits
22

33
* [Why async fn in traits are hard][wafth]
44

@@ -81,3 +81,8 @@ trait MyMethod {
8181
async fn foo(&self);
8282
}
8383
```
84+
85+
## 🤔 Frequently Asked Questions
86+
87+
* **What do people say about this to their friends on twitter?**
88+
* (Explain your key points here)

src/design_docs/async_lifecycle.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# ♻️ Async lifecycle

src/design_docs/async_main.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# 🎇 Async main
2+
3+
## What is it?
4+
5+
## Motivation
6+
7+
## Frequently Asked Questions

0 commit comments

Comments
 (0)