Live data from Hacker News

Python has had async for 10 years – why isn't it more popular?

tonybaloney.github.io

11–20 of 305 posts

Re: Python has had async for 10 years – why isn't it more popular?

#11
Yes, this!. Its a mess, some typing, some async. No standardization/ one way to do things. Literally goes against the original ZEN of python

"There should be one-- and preferably only one --obvious way to do it : Aim for a single, clear solution to a problem. "

Re: Python has had async for 10 years – why isn't it more popular?

#12
Because it takes a a lot of reading/studying/experimentation to get things right.

I'm personally halfway through that journey (having spent like 4h reading docs/learning, on top of the development). I suspect it could have been designed in such a way so that it's less trivially easy to mess up.

Re: Python has had async for 10 years – why isn't it more popular?

#14
The author gets close to what I think the root problem is, but doesn't call it out.

The truth is that in python, async was too little, too late. By the time it was introduced, most people who actually needed to do lots of io concurrently had their own workarounds (forking, etc) and people who didn't actually need it had found out how to get by without it (multiprocessing etc).

Meanwhile, go showed us what good green threads can look like. Then java did it too. Meanwhile, js had better async support the whole time. But all it did was show us that async code just plain sucks compared to green thread code that can just block, instead of having to do the async dances.

So, why engage with it when you already had good solutions?

Re: Python has had async for 10 years – why isn't it more popular?

#19
With the newest Python, I can use no-gil, so my threads automatically use multiple cores. With asyncio, even under no-gil, unless I use a base layer that offers parallelism, I am stuck to a single core by default, which doesn't make any sense in a multicore world. In contrast, with Rust's async, there is no such limitation.

The traditional argument against the above assertion has been that asyncio is good for I/O work, not for CPU work, but this constraint is not realistic because CPU usage is guaranteed to creep in.

In summary, I can use threading/process/interpreter pools and concurrent futures, considering I need them anyway, without really needing to introduce yet another unnecessary concurrency paradigm (of asyncio).

Post reply on HN