-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Write chapter about async Rust #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I just looked through my Rust books, and most don't actually cover async/await. The one that does is Rust for Rustaceans. Its ordering is similar to what's given above: it starts with polling, then futures, then a long section on pinning, then wakers and context, and finally spawning and tasks. I don't think that's appropriate for an introductory course, especially for the very end of one -- nobody's going to have headspace left to grok Pin at the end of day 4. Instead, I think we should go in the opposite order, and start with an What do you think? I've gotten a start on this and I'll put up a PR shortly. |
I totally agree that for an introductory course it is better to avoid going into the details of pinning and polling. I think we could base the course materials on the first few chapters of https://rust-lang.github.io/async-book/, possibly, sections 1, 3, 4 and 6. But I have only skimmed through the book. I think that is more or less what you are suggesting :) |
Yeah, I agree with that — I don't feel I fully understand pinning myself, but that doesn't stop me from writing async Rust code 😄 When writing this, be careful to avoid forward references. That is, try to apply a principle of showing things in a way that builds upon previously shown content. I didn't do that very strictly in the main course and I would like to start reorganizing it to follow this principle. Since this is new material, you have the chance of applying it from the beginning. As for this being an introduction or not: I imagine you have a full day, so 5-6 hours to play with. I hope that is enough to let people get their hands dirty with some actual code. Maybe it could be useful to find a nice exercise and then work backwards to figure out what needs to be covered for people to solve it. I bet that pinning won't be super important then. |
Very good point. Will keep this in mind.
I was thinking of half a day. Concurrency in the morning as before, then Async in the afternoon. In any case pinning is too complicated :) |
Yes, that would make sense if the material is light and fits. I'm thinking it won't actually fit and so we should prepare to use the full day. That would match the current thinking of creating small spin-off courses for special topics. That was touched upon here. But we'll see as the material gets written |
We should write a chapter about async Rust. This would be a good alternative to the Android part on Day 4. A possible agenda could look like this:
await
The text was updated successfully, but these errors were encountered: