13 ms·
> In C# if you're not careful your codebase gets littered with tasks everywhere, even in code that has nothing to do with concurrency originally. This is a spo
by k_bx 8y ago
> In C# if you're not careful your codebase gets littered with tasks everywhere, even in code that has nothing to do with concurrency originally.
This is a spot-on. The only language I know that did this all right is Haskell, where most of your code doesn't need any thinking of async operations (either runtime gets you covered, or function takes a callback as a parameter, instead of any await magic), and when you need them -- you have `async` library that gets all you need.
- platz 8y agoa common misconception.. haskell does not "auto-async" anything. Laziness is not Async. You explicitly provide instructions which expressions get turned into async expressions in Haskell.
- k_bx 8y agoI never stated anything remotely close to that :) What I've meant are: - either Haskell gives you API which is done "right", without any Async types. For example, `bracket` function - or runtime gives you lightweight threads by default, so you can just `fork myComputation` and it'll run in a lightweight thread which "just works" - or finally, in rare situations of interleaving different computations with complex dependencies, you just use the `async` library, which is not a special language construct but a library, which lets you "await" and all that