4 ms·
If they had written it in Rust this never would have happened
by brian-armstrong 8y ago
If they had written it in Rust this never would have happened
- dang 8y agoMaybe not, but please don't post unsubstantive comments here.
- deathanatos 8y agoMy understanding is that most of Rust's standard library translates to the same blocking calls on Linux, so it would be plagued with the same issues as C would be. (And the solution reached in the article would similarly work in Rust.) There are certainly async I/O libraries for Rust (e.g., Tokio), but those are going to be limited by the primitives the OS gives them. (AFAIK, Tokio's core libraries don't directly do async disk I/O; there is tokio-fs, and it does it by shunting the work to a threadpool.) The fact that disk I/O is so uniquely special on Linux effects any language, as it is an aspect of the kernel itself. I love Rust, and while there are a ton of compelling reasons to use it, I don't think it's fair to say it would have prevented this from happening, in this particular case.
- hjnilsson 8y agoPerhaps, but the first version of Rust appeared 6 years of nginx was launched, so it was never a choice. However, development of a new web server in Rust is an interesting project, and could certainly compete with nginx over time if enough effort was put into it.