News for hackers. Stuff that matters.
Re:Swift on the Server (2020) by rnantes on Sunday April 25, 2021 @04:29PM (#26936370)
If you look on the Swift GitHub page you will see tremendous effort going into async/await. It will change the game for server side swift later this year.
Re:Swift on the Server (2020) by elpakal on Sunday April 25, 2021 @05:08PM (#26936704)
this! lack of proper async support has been a big deterrent for me when considering Swift on my server or even Docker/CLI project. I worried that things like SwiftNIO/Vapor would change significantly when async landed and would require a lot of upkeep... I look forward to async landing.
Re:Swift on the Server (2020) by k_bx on Sunday April 25, 2021 @04:31PM (#26936392)
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.
Re:Swift on the Server (2020) by nextaccountic on Sunday April 25, 2021 @04:44PM (#26936502)
> Everything is async in Haskell, so you don’t need to think about it,

Then why does https://hackage.haskell.org/package/async exist?

Re:Swift on the Server (2020) by eecc on Sunday April 25, 2021 @05:11PM (#26936727)
I 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.

Re:Swift on the Server (2020) by k_bx on Monday April 26, 2021 @01:06AM (#26939388)
Nothing 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
Re:Swift on the Server (2020) by k_bx on Monday April 26, 2021 @01:04AM (#26939380)
Please 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