@@ -8,28 +8,29 @@ author: Niko Matsakis
8
8
Rust, as part of the 1.39.0 release.** This work has been a long time
9
9
in development -- the key ideas for zero-cost futures, for example,
10
10
were [ first proposed by Aaron Turon and Alex Crichton in
11
- 2016] [ zcf-rust ] ! -- and we are very proud of the end result! We
12
- believe that Async I/O -- and async-await in particular -- is going to
13
- be an increasingly important part of Rust's story.
11
+ 2016] [ zcf-rust ] ! -- and we are very proud of the end result. We believe
12
+ that Async I/O is going to be an increasingly important part of Rust's
13
+ story.
14
14
15
15
While this first release of "async-await" is a momentous event, it's
16
16
also only the beginning. The current support for async-await marks a
17
17
kind of "Minimum Viable Product" (MVP). We expect to be polishing,
18
18
improving, and extending it for some time.
19
19
20
20
Already, in the time since [ async-await hit beta] [ aa-beta ] , we've made
21
- a lot of great progress -- including making some [ key diagnostic
22
- improvements] [ diag ] that help to make async-await errors more
21
+ a lot of great progress, including making some [ key diagnostic
22
+ improvements] [ diag ] that help to make async-await errors far more
23
23
approachable. To get involved in that work, check out
24
- the [ Async Foundations Working Group] [ wg ] -- if nothing else, you can
25
- help us by filing bugs about polish issues or by [ nominating those bugs
26
- that are bothering you the most] [ nom ] , to help direct our efforts.
24
+ the [ Async Foundations Working Group] [ wg ] ; if nothing else, you can
25
+ help us by filing bugs about polish issues or by [ nominating those
26
+ bugs that are bothering you the most] [ nom ] , to help direct our
27
+ efforts.
27
28
28
29
# Major developments in the async ecosystem
29
30
30
31
Now that async-await is approaching stabilization, all the major Async
31
- I/O runtimes are busily at work adding and extending their support for
32
- the new syntax:
32
+ I/O runtimes are at work adding and extending their support for the
33
+ new syntax:
33
34
34
35
* the [ tokio] runtime [ recently announced a number of scheduler
35
36
improvements] [ tokio-sched ] , and they are planning a stable release
@@ -81,10 +82,10 @@ To use async-await, you start by writing `async fn` instead of `fn`:
81
82
async fn first_function () -> u32 { .. }
82
83
```
83
84
84
- Unlike a regular function, calling an ` async fn ` doesn't do anything
85
- to start -- instead , it returns a ` Future ` . This is a suspended
86
- computation that is waiting to be executed. To actually * execute*
87
- the future, you have to use the ` .await ` operator:
85
+ Unlike a regular function, calling an ` async fn ` doesn't have any
86
+ immediate effect. Instead , it returns a ` Future ` . This is a suspended
87
+ computation that is waiting to be executed. To actually * execute* the
88
+ future, use the ` .await ` operator:
88
89
89
90
``` rust
90
91
async fn another_function () {
@@ -111,8 +112,8 @@ The other difference between Rust futures and futures in other
111
112
languages is that they are based on a "poll" model, which makes them
112
113
** zero cost** . In other languages, invoking an async function
113
114
immediately creates a future and schedules it for execution: awaiting
114
- the future isn't really necessary for it to execute. But this implies
115
- some overhead for each future that is created.
115
+ the future isn't necessary for it to execute. But this implies some
116
+ overhead for each future that is created.
116
117
117
118
In contrast, in Rust, calling an async function does not do any
118
119
scheduling in and of itself, which means that we can compose a complex
0 commit comments