Hacker News new | ask | show | jobs
by ildjarn 813 days ago
Colored functions is only a problem in JS
2 comments

And Python... And Rust... And C#...
And C#, Python, Rust...
You can de-color an async function by blocking.
In most implementations, blocking in an async function has unintended side effect of blocking all other async function running on the same executor.
It's not the case in C#. It is discouraged, but mainly because there just used to be so much sloppily written async code that managed to bring down threadpool to its knees despite hillclimbing and blocked threads detection doing a lot of heavy lifting, so the community has grown scar tissue against this. It's rarely an issue if ever in the last 5 years or so.