←back to thread

320 points willm | 3 comments | | HN request time: 0.631s | source
Show context
atomicnumber3 ◴[] No.45106455[source]
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?

replies(24): >>45106558 #>>45106616 #>>45106659 #>>45106663 #>>45106684 #>>45106758 #>>45107048 #>>45107148 #>>45107247 #>>45107394 #>>45107701 #>>45107865 #>>45108486 #>>45108978 #>>45109142 #>>45109610 #>>45109958 #>>45110033 #>>45110052 #>>45110805 #>>45111877 #>>45111901 #>>45113010 #>>45113188 #
pnathan ◴[] No.45107148[source]
Async taints code, and async/await fall prey to classic cooperative multitasking issues. "What do you mean that this blocked that?"

The memory and execution model for higher level work needs to not have async. Go is the canonical example of it done well from the user standpoint IMO.

replies(2): >>45108994 #>>45110383 #
hinkley ◴[] No.45108994[source]
The function color thing is a real concern. Am I wrong or did a python user originally coin that idea?
replies(1): >>45109738 #
throwawayffffas ◴[] No.45109738[source]
No it was a js dev complaining about callbacks in node. Mainly because a lot of standard library code back then only came in callback flavour. i.e. no sync file writes, etc.
replies(2): >>45110108 #>>45110369 #
LtWorf ◴[] No.45110108[source]
Which is really funny because the linux kernel doesn't do async for file writes :D
replies(1): >>45112644 #
1. yxhuvud ◴[] No.45112644[source]
Uh, io_uring does that just fine.
replies(1): >>45112649 #
2. LtWorf ◴[] No.45112649[source]
That's yet another thing though.
replies(1): >>45135437 #
3. yxhuvud ◴[] No.45135437[source]
It is part of the kernel and it does async file writes, so I don't really understand your objection.