Re:Rust Is Hard, Or: The Misery of Mainstream Programming
by 3np on Thursday June 02, 2022 @09:31PM
(#31603129)
Are you sure you are talking about Haskell and not Erlang? I'm not aware of how Haskell IO would be "automatically async".
[ Parent
| on HN ]
Re:Rust Is Hard, Or: The Misery of Mainstream Programming
by chowells on Thursday June 02, 2022 @09:55PM
(#31603306)
That's definitely a description of GHC Haskell. All network IO in Haskell goes through a subsystem called the IO manager, which makes use of platform appropriate high-performance non-blocking APIs. (Actually, I think windows isn't getting an IOCP implementation until the next major release, but Windows has always been a bit undersupported by GHC.)
The nice thing about this is... You don't have to care. Haskell is a good enough programming language to just put the platform-specific non-blocking hell APIs in a library and let you write code that looks linear and blocking. If you want more control you can get down to the low level non-blocking APIs, but that's usually not going to be worth the trouble.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming
by marcosdumay on Friday June 03, 2022 @12:13AM
(#31604208)
Yeah, many people don't even see a reference about Haskell IO being async. That's what the "automatic" part is doing.
Haskell IO is basically as async as Javascript, as in every operation is fully asynchronous, you need to call some foreign function if you want otherwise. Except that you have parallelism and can have concurrency too added if you want.