3 ms·
You know what, I’ve heard people say this and thought “OK, maybe these other languages with GCs and huge runtimes really do something magical to make async a br
by simonask 7mo ago
You know what, I’ve heard people say this and thought “OK, maybe these other languages with GCs and huge runtimes really do something magical to make async a breeze”.
But then I actually tried both TypeScript and C#, and no. Writing correct async code in those languages is not any nicer at all. What the heck is “.ConfigureAwait(false)”? How fun do you really think debugging promise resolution is? Is it even possible to contain heap/GC pressure when every `await` allocates?
Phooey. Rust async is doing just fine.
- palata 7mo agoHow does it compare to Kotlin async? I find Kotlin generally hits a good balance across the board.
- usrnm 7mo agoTry golang, where they did the only sane thing: everything is async from the very beginning, no function colouring
- simonask 7mo agoI think practical experience with Go reveals that this choice being “the only sane thing” is highly debatable. It comes with huge drawbacks.
- usrnm 7mo agoOf course it has drawbacks, everything does, but my practical experience has been hugely in favor of what golang is doing, at least, in terms of cognitive load and code simplicity. It is very much worth it in many, many cases
- mrsmrtss 7mo agoIn .NET 11 C# async management moved to the runtime, mostly eliminating heap allocations and also bringing clean stack traces. You really only need to think about ConfigureAwait(false) when building shared libraries or dealing with UI frameworks (even there you mostly don't need it).
- simonask 7mo agoYou speak in the past tense, but .NET 11 is not released yet at time of writing. Runtime-async is not the current reality.
- mrsmrtss 7mo agoTrue, it's in preview currently, but actually .NET is already very efficient with async today also - https://hez2010.github.io/async-runtimes-benchmarks-2024/ https://hez2010.github.io/async-runtimes-benchmarks-2024/ (.NET9 tested here).
- simonask 7mo agoSure, it’s really fine for what it does, but it is not significantly easier to deal with than Rust async, and remains fundamentally unsuited in several scenarios where Rust async works really well.
- pjmlp 7mo agoUnless you are writing GUI code, ConfigureAwait() shouldn't be on your source code.