(no title)
siekmanj | 3 years ago
edit: ray https://github.com/ray-project/ray is also pretty easy to use and powerful for actual parallelism
siekmanj | 3 years ago
edit: ray https://github.com/ray-project/ray is also pretty easy to use and powerful for actual parallelism
BugsJustFindMe|3 years ago
coldtea|3 years ago
Do you compare it to threads and pools, or judge it on its merits as an async framework (with you having experience of those that you think are done better elsewhere, e.g. in Javascript, C#, etc)?
Because both things you mention "demands on how you build your code" and "limited scope" are part of the course with async in most languages that aren't async-first.
dekhn|3 years ago
Joker_vD|3 years ago
sgtlaggy|3 years ago
dragonwriter|3 years ago
You are confusing concurrency and parallelism.
> Threading is "implicit" context switching all in the same process/thread
No, threading is separate native threads but with a lock that prevents execution of Python code in separate threads simultaneously (native code in separate threads, with at most on running Python, can still work.)
hn_saver|3 years ago
uniqueuid|3 years ago
But when you try to do things that aren't a map-reduce or Pool.map() pattern, it suddenly becomes pretty warty. E.g. scheduling work out to a processpool executor is ugly under the hood and IMO ugly syntactically as well.
tandav|3 years ago
Are you talking about this example? https://docs.python.org/3/library/asyncio-eventloop.html#asy...
ikinsey|3 years ago
However, batteries are not included. For example, it provides no HTTP client/server. It doesn't interop with any synchronous IO tools in the standard library either, making asyncio a very insular environment.
For the majority of problems, Go or Node.js may be better options. They have much more mature environments for managing asynchrony.
1337shadow|3 years ago
stepanhruda|3 years ago
unknown|3 years ago
[deleted]
fastball|3 years ago
ikinsey|3 years ago
[1] https://docs.python.org/3/library/asyncio-eventloop.html#asy...
siekmanj|3 years ago