4 ms·
I kind of wish we'd just add Go-style CSP to python and call it a day - it seems to be the best of both worlds when it comes "do two things at the same time".
by XorNot 4y ago
I kind of wish we'd just add Go-style CSP to python and call it a day - it seems to be the best of both worlds when it comes "do two things at the same time".
- TOMDM 4y agoGo's concurrency is such a breath of fresh air whenever I interact with it. Python would be immediately so much easier to use for so many other cases if it implemented something similar.
- meowface 4y agoI'm not sure how much it replicates the CSP model, but the closest thing I've found to Go-style concurrency in Python is gevent: https://github.com/gevent/gevent https://github.com/gevent/gevent I personally still prefer to use it in all my projects.
- Mlller 4y agoI do, too, for websites, although I try to avoid dependencies like a snowflake the fire. But doing nothing more than using gevent server and putting from gevent import monkey monkey.patch_all() at the top of the main module was such a game changer.
- Yaser_Amiri 4y agoI actually tried to build a CSP interface on top of AsyncIO, It's still experimental an I haven't developed it for sometime but you know, It works. https://github.com/Yaser-Amiri/one-ring/blob/main/docs/samples.rst https://github.com/Yaser-Amiri/one-ring/blob/main/docs/sampl... As long as GIL exists with current conditions, we will not have a Go-like CSP, but that's about scheduling, not the CSP itself.
- XorNot 4y agoWell that's the thought: GIL-less Python is coming, at which point we can actually have something like this and it'll just work.