3 ms·
I don’t know how Swift works, but from my Haskell experience, if your language needs async/await —- it’s already failing. Everything is async in Haskell, so you
by k_bx 5y ago
I don’t know how Swift works, but from my Haskell experience, if your language needs async/await —- it’s already failing. Everything is async in Haskell, so you don’t need to think about it, and cannot accidentally make a mistake by blocking your async thread by calling sync code from it.
- nextaccountic 5y ago> Everything is async in Haskell, so you don’t need to think about it, Then why does https://hackage.haskell.org/package/async https://hackage.haskell.org/package/async exist?
- eecc 5y agoI think what he means is that everything in Haskell is "async" because the language runtime is lazy and types can encode parallelism: monads and functors fro sequential, blocking code, while applicatives for independent code. Not sure if it's actually correct though.
- k_bx 5y agoNothing to do with laziness. It just means you cannot accidentally call blocking (sync) operation from a lightweight (async) thread and block a whole bunch of other lightweight threads like in Rust, C#, or other languages with explicit “async” keyword
- k_bx 5y agoPlease keep in mind it’s a library, not a language extension. It exists same reason any other library exists. It’s a useful set of combinators