by hermanradtke on 2/25/24, 2:37 AM with 70 comments
by jandrewrogers on 2/25/24, 6:35 AM
This is not to suggest that async models are a bad idea. They just have a higher level of intrinsic complexity and language support is immature. The benefit is qualitatively better scalability and performance, so there is a purpose behind using async models.
by pdimitar on 2/25/24, 7:39 AM
I know that Rust does not have a runtime and it does not have a spec but I think the questions posed in the article hint at the need for either -- or even both at the same time (i.e. "make a spec for the third party runtime implementors").
I am not saying "imitate Golang or Erlang". I am saying: "just pick a side already".
On a more intuitive level: to me it feels like Rust tries to be everything for everyone, and I think many of us know that will never work.
Choose. Commit. Double down. Make it work. Golang and Erlang did. Rust can do it as well.
by u320 on 2/25/24, 9:00 AM
by georgelyon on 2/25/24, 5:49 AM
There are a number of other proposals linked to this issue that can be referenced from that thread. I hope there is a next generation async model for future languages that is truly simple, because this all makes me think footguns are endemic to the current approach (which is broadly the same in Rust and Swift).
by feverzsj on 2/25/24, 7:19 AM
by lordmauve on 2/26/24, 7:16 AM
This happens all the time. For example, cancellation in the middle of sending a HTTP request. The connection is now unusable and must be closed. Without cancellation the connection returns to a state where it can be used and is re-added to a pool.
by PoignardAzur on 2/25/24, 12:22 PM
Note that this is true for UNIX file descriptors, but not for C++ streams: an error when closing may indicate that the stream you closed had some buffered data it failed to flush (for any of the reasons that a failed write might come from).
In that case, you sometimes do want to take a different codepath to avoid data loss; eg, if your database does "copy file X to new file Y, then remove X", if closing/flushing Y fails then you absolutely want to abort removing X.
In the case of Rust code, the method you want is `File::sync_all`, which returns a Result for this exact purpose.
by hardwaresofton on 2/25/24, 11:26 AM
by asabil on 2/25/24, 2:20 PM
That would be Erlang.
by ggreg84 on 2/25/24, 4:12 PM
I wonder what's so different about rust that they can't solve it in the same way.
by 38 on 2/25/24, 6:27 AM
Guy is in a bubble. He doesn't realize that 99% of rust programmers don't have the experience he does.