3 ms·
the fact that some languages can't do it might point to the fact that it is not as simple as it seems. network programming is hard. really hard. Saying that as
by accountofme 5y ago
the fact that some languages can't do it might point to the fact that it is not as simple as it seems.
network programming is hard. really hard. Saying that async magically removes all that complexity is false. The complexity is moved into the executor, if the executor is out of your control you are up shit creek.
Finally If languages like python can't do it well that says something...
- AaronFriel 5y agoPython struggles with it because so much networking code deep in networking libraries such as gunicorn, database libraries like psycopg, depend (or did depend) upon mutable global state and non-reentrant blocks of code that, upon introducing concurrency result in all a manner of poor behavior. Do a search for "psycopg2 decryption failed or bad record mac" for example. Or replace psycopg2 with celery, or gunicorn. Python has a difficult history of half-way attempts to parallelize, a half dozen eventlet libraries that never made it to the standard, and only recently - in terms of library support - is an official coroutine implementation available, albeit not as widely used as it needs to be. Library support is still widely lacking. It's not that Python can't do it well, it's that the ecosystem has dug themselves a pit by doing things that aren't legal Rust and would be frowned upon in other languages. Those hacks to support parallelism and greenlets, gevent, etc. rely upon juggling file descriptors and carefully tweaking global state in each library. It's gnarly stuff and results in errors that are clearly the result of failing to catch all the balls correctly. Those SSL errors, by the way, are incredibly concerning. It means that wires are getting crossed and if it weren't for SSL authenticating the packets, the wrong data would happily get sent or received to the wrong party. In a network server, yikes.