News for hackers. Stuff that matters.
Re:Red and blue functions are a good thing by merb on Monday April 26, 2021 @05:49PM (#26948665)
the problem is that if you introduce async, your could should preferably async all the way to the bottom. of course you can trick yourself by using thread pools and move long running functions to them, but not everybody knows that.

of course sync functions have the same problem (not the same problem, but it's the same concept, just in the other way), except that most frameworks just deal with it at the very front, so developers do not need to deal with it.

Re:Red and blue functions are a good thing by pornel on Tuesday April 27, 2021 @07:51AM (#26954682)
The whole point is that use of async doesn't need to be infectious. You may want to make everything async for elegance and consistency, but it's not a requirement strong enough to cause problems. If you have a library that is sync-only, it's fine. If you have a large project and can't be bothered to rewrite everything to be async, it's fine.

"Not everybody knows (how to do) that" is a weak argument, because it's a relatively straightforward thing to learn: if it can block, wrap it in `spawn_blocking()`.

Re:Red and blue functions are a good thing by ibraheemdev on Monday April 26, 2021 @07:25PM (#26949613)
> of course you can trick yourself by using thread pools and move long running functions to them

How is that tricking yourself? Blocking code exists, and you will almost always run into it one way or the other.