Top
Best
New

Posted by willm 9/2/2025

Python has had async for 10 years – why isn't it more popular?(tonybaloney.github.io)
324 points | 295 commentspage 7
ayaros 9/2/2025|
I love JS's async. I don't know how anyone ever did anything useful in the language before it was introduced. I think something between a third and half of the functions and members in LisaGUI are probably async functions at this point.
steve_adams_86 9/3/2025|
We used callbacks and generators. It was a bit messy at times, but really, it wasn't all that different. I still use generators quite often.
ayaros 9/4/2025||
Oh... only a "bit" messy, you say? ;)
steve_adams_86 9/5/2025||
Haha, yeah. I didn't find generators messy at all, but callbacks led to the term 'callback hell' for good reason.

I think there's a good reason as well that async generators are at the core of async/await, but people rarely use them outside of abstractions. I like them, but they are a lower level tool for sure. Once they 'click' and you feel good with them, great, but chances aren't very good that everyone you work with will feel the same.

Generators add on a sort of cognitive overhead more than mess, I guess. Sometimes it makes sense to pull them out, but often it doesn't. Promises probably encapsulate 95% of common use cases. Promises just do one thing, whereas everywhere you use generators, you've got all the power and potential of generators. Kind of a 'great power, great responsibility' problem

wodenokoto 9/3/2025||
> If you call function get_thing_sync() versus await get_thing_async(), they take the same amount of time.

No, if you call both function one will try and fetch a none responding url and the other will immediately raise an exception.

dekhn 9/2/2025||
It added intrusive- codebase-wide- functionality that more or less could have been done with other (thread-based) approaches.

AWSCLI was broken for over a year- we had to do a ton of work to deal with the various packaging issues.

Don't break userspace.

AtlasBarfed 9/2/2025|
Why was awscli written in python? Bad decision to begin with.

Hey! We have a product that we clearly want to release worldwide. Let's build it on something that doesn't have Unicode. Or any real threading. And is slow as hell.

You picked a platform that was going to have to break user space.

At least it wasn't JavaScript

mdaniel 9/3/2025|||
I guess at least they're consistent (or maybe herd mentality) since both azure-cli and gcloud are both in python, too
mdaniel 9/3/2025||||
but, hey, at least they get to be ultimately dynamic, leading to horeshit like this https://github.com/aws/aws-cli/blob/2.28.22/awscli/botocore/...

What does `create_client` return?! don't you worry your pretty head about it, it'll be whatever you want it to be! flexability!!11

fzzzy 9/2/2025|||
Doesn’t have Unicode? What the heck?
mdaniel 9/3/2025||
I believe they're discussing that awscli was targeting Python 2.x for the longest time, e.g. https://github.com/aws/aws-cli/blob/0.4.1/setup.py#L48 up through https://github.com/aws/aws-cli/blob/1.19.112/setup.py#L64 from 4 years ago, seemingly cutting over to Py3-only starting with https://github.com/aws/aws-cli/blob/1.20.0/setup.py#L62

I didn't go digging into it, but I'd guess they used the ubiquitous "six" library for backporting unicode functionality, but the point is likely "but why start underwater?!"

dec0dedab0de 9/2/2025||
It's had async way longer than 10 years. multi-threading/processing, celery, twisted, others I can't remember.

Asyncio means learning different syntax that buys me nothing over the existing tools. Why would I bother?

baq 9/2/2025||
async, parallelism, concurrency, why not all three? JS, the canonical async (at least today) language, has had neither parallelism nor concurrency primitives for a good decade or so after its inception.

I personally blame low async adoption in Python on 1) general reduction in its popularity vs Typescript+node, which is driven by the desire to have a single stack on the frontend and backend, not by bad or good async implementations in Python (see also: Rails, once the poster child of the Web, now nearly forgotten) 2) lack of good async stdlib. parallelism and concurrency are distant thirds.

dragonwriter 9/2/2025|
> async, parallelism, concurrency, why not all three?

async is a concurrency mechanism.

JackSlateur 9/2/2025||
async enables a concurrency potential, nothing more

That is, if you use external stuff and can delegate work to them, then async is concurrent (async io for instance)

But if you do not, then async is regular code with extra steps

DanielHB 9/2/2025||
I do not understand what you mean, parallelism is running multiple concurrent execution blocks running in multiple physical CPUs at the same time.

My understanding is that JS can't do that (besides service workers which are non-shared memory), but it still has multiple concurrent code-blocks being executed at the same time, just in linear fashion. It will just never use multiple CPU cores at the same time (unless calling some non-JS non-shared-memory code)

hk1337 9/3/2025||
It's not as easy to implement as it is in javascript though.

If someone has it already implemented, like say in FastAPI, then it's pretty trivial to use but to just use async is kind of a pain.

Animats 9/3/2025||
Python has had threads for 20 years. Why weren't they more popular?
adfm 9/2/2025||
Twisted?
lstodd 9/2/2025|
And Tornado. Please don't remind me of those horrors.
est 9/3/2025||
> Problem 3: Maintaining two APIs is hard

Well I had a fix https://news.ycombinator.com/item?id=43982570

stillsut 9/3/2025|
Not an expert but my chats with ChatGPT led me to believe async + FastAPI can give you 40x throughput for request handling over non-async code.

The essential idea was I could be processing ~100 requests per vCPU in the async event loop while threading would max out 2-4 threads per CPU. Of course let us assume for either model we're waiting for 50-2000ms DB query or service call to finish before sending the response.

Is this not true? And if it is true, why isn't the juice is worth the squeeze: more than an order of magnitude more saturation/throughput for the same hardware and same language, just with a new engine at its heart?

More comments...