3 ms·
The problem is the threading solutions for python fill bolted on, and kind of break the whole "pythonic" feel of everything. Of course this is purely subjective
by codygman 14y ago
The problem is the threading solutions for python fill bolted on, and kind of break the whole "pythonic" feel of everything. Of course this is purely subjective, but for me it feels like I'm "going against the grain" and falling out of the domain space of problems the language was meant for.
That, and Go seems to be close enough to python with those advantages built in that it becomes an easy choice for me. Combine that with the fact that my problems are mostly solved easily with the inbuilt libraries, and it's a clear solution.
I mean, look at the docs for gevent. In the docs one of the first things they teach is monkey patching:
http://www.gevent.org/intro.html#monkey-patching http://www.gevent.org/intro.html#monkey-patching
- rdtsc 14y ago> The problem is the threading solutions for python fill bolted on, and kind of break the whole "pythonic" feel of everything. See I find a lot Twisted, and yield based concurrency frameworks not being Pythonic enough. Threads are just functions that run concurrently. In the case of green threads it is really just as simple as spawn(func) to start a new green thread running function func(). Take a look at these eventlet examples, they are pretty elegant: http://eventlet.net/doc/examples.html http://eventlet.net/doc/examples.html Yes there is monkey patching. However, that happens once per program at the very top. That is a small price to pay for the ability to use all the Python libraries out there. Speaking of libraries. That is one good thing about Python. And probably the reason to stick to it -- the large library ecosystem. Of course it depends on the system you are designing but a large enough system will usually need some other libraries (parsing a protocol, using a work queue etc). Go and Erlang also have plenty, but not nearly the level and breadth that Python has.
- codygman 14y agoThis is a fair solution, and I believe that gevent was the best solution IMO for python although I only gave it a cursory glance. However, type checking is what ultimatley won out here along with Go's very C+Python love child feeling.