Async Rust: Unleashing the Power of Fearless Concurrency

This Post Has 2 Comments

  1. Disappointing from O’Reilly
    This book seemed rushed, and possibly picked the wrong authors.Firstly, there is quite a high density of typos in the book. This does not particularly damage the reading experience — I know what “S syntax changes” and ‘version = “1..39.0” are aiming at — but clearly no copy editor was employed to check the final version.But there are also more substantive issues arising from the rush. Chapter two has a paragraph in the middle that was clearly supposed to be the end of the chapter: “we can move on to Chapter 3, where we…” But then there’s another section following that, and the prose quality falls drastically. I’m fairly sure it was added at the last minute and unedited.All of that would be fine if the book offered deep insights into the subject. But it falls well short there too, at least for what I was looking for.The entire topic of `Pin` is covered in two pages by noting that moving structures with self-referential pointers would be bad. But there’s no hint about why this is a particular problem for async code, and it comes before the `async` syntax is “introduced” (i.e. suddenly used with skimpy explanation) so no connection can be made either. I only have a vague sense of this topic, but even from that I know there’s a lot of important foundational understanding missing there.Chapter three is better, but still shallow. The `async_task` crate is used to abstract away the bits that I would be most interested in, but its actions are never explained. I had to go read the documentation for that crate before I understood what was going on in that chapter.I was excited to hit chapter five (coroutines) because I was unaware that Rust had any support for this. (It’s unstable, and nightly-only, but still.) I reached the end of the chapter and none of the examples were actually coroutines! They were all stateless and would have been better written as simple functions. The chapter didn’t make sense to me so I found the Rust documentation on the feature. There’s a coroutine syntax to cause the compiler to do a state-machine transformation of the code (the whole point!) which is never mentioned or used in the chapter!I’m left wondering if the authors have any idea what a coroutine is, or whether it was a bullet point in an outline and someone took a guess in a hurry. I lost faith at that point and have only skimmed the rest of the book.I would have been happy enough with a manual for tokio, which ignored all the low-level bits, but this book isn’t that either. It uses tokio in some examples, but is in no way a useful manual for it.

Leave a Reply

Your email address will not be published. Required fields are marked *