GREAT SOLUTIONS IN ENGINEERING Problem: bicycle seats are hard. They hurt. Analysis: there must be something wrong with your pants. "Solution": dorky pants. from http://dilbert.com/strips/comic/1994-07-18/ Problem: Python has poor support for threads, and concurrency in general. Analysis: you must need more middleware. "Solution": incomprehensible callback-based frameworks.
The Twisted Way
11–20 of 32 posts
Re: The Twisted Way
#12GREAT SOLUTIONS IN ENGINEERING Problem: bicycle seats are hard. They hurt. Analysis: there must be something wrong with your pants. "Solution": dorky pants. from http://dilbert.com/strips/comic/1994-07-18/ Problem: Python has poor support for threads, and concurrency in general. Analysis: you must need more middleware. "Solution": incomprehensible callback-based frameworks.
If by incomprehensible, you mean you need to read more than 10 pages of documentation to understand it, then sure.
#1 In python specifically, we do not have proper closure and no anonymous blocks, this makes operating it tedious as the definition of the logic for a callback is always somewhere else from where the callback is setup.
#2 In any language supporting proper closures (javascript for instance, hello node.js) excessive, nested use of callback based frameworks leads to the phenomenon of the pyramid of death, whereas you keep nesting closures and you have to keep them all in one place because each depends on its outer scope.
I intently dislike twisted and node.js for these very reasons. I've written my own little framework based entirely on greenlets in python, which is delightful and easy to use and entirely avoids both dislocality of action and the pyramid of death.
Re: The Twisted Way
#13It's certainly a difficult thing to get your head around. The parts of the project that touch twisted is always the most complex to explain to anyone else. However, async code is always hard. It also doesn't help that the code base shows it's age.. non-PEP8, strange naming conventions etc.
However, one thing that I've noticed with recent projects using Tornado (https://github.com/rhettg/Dynochemy) is that some concepts that I thought was overly complex in Twisted makes sense eventually. For example, handling errors in async code is really hard. The framework twisted came up with with Deferred, callbacks and errbacks is pretty smart. You almost have to re-invent twisted before you can appreciate it.
I'd recommend reading the original paper for more information: http://www6.uniovi.es/python/pycon/papers/deferex/
Re: The Twisted Way
#14Re: The Twisted Way
#15GREAT SOLUTIONS IN ENGINEERING Problem: bicycle seats are hard. They hurt. Analysis: there must be something wrong with your pants. "Solution": dorky pants. from http://dilbert.com/strips/comic/1994-07-18/ Problem: Python has poor support for threads, and concurrency in general. Analysis: you must need more middleware. "Solution": incomprehensible callback-based frameworks.
If by incomprehensible, you mean you need to read more than 10 pages of documentation to understand it, then sure.
Re: The Twisted Way
#16Re: The Twisted Way
#17Earlier quoted context omitted.
If by incomprehensible, you mean you need to read more than 10 pages of documentation to understand it, then sure.
There are two problems with callback based frameworks. #1 In python specifically, we do not have proper closure and no anonymous blocks, this makes operating it tedious as the definition of the logic for a callback is always somewhere else from where the callback is setup. #2 In any language supporting proper closures (javascript for instance, hello node.js) excessive, nested use of callback based frameworks leads to…
Twisted feels to me like a grand experiment that's groping towards something that we know is there, but not quite catching it yet. I guess I/O monads feel like slightly further along the path - but they're still not the true solution. What does your system look like?
Re: The Twisted Way
#18Re: The Twisted Way
#19Twisted is the least accessible of the big Python libraries that I've come across. I've come to it a couple of times when it seemed like it would suit a problem I had, only to throw up my hands in frustration and go look for a solution somewhere else. Unfortunately this article did nothing to enlighten me - it has some pretensions of being philosophical without explaining any of the practicalities. Does anyone use Tw…
Re: The Twisted Way
#20Twisted is the least accessible of the big Python libraries that I've come across. I've come to it a couple of times when it seemed like it would suit a problem I had, only to throw up my hands in frustration and go look for a solution somewhere else. Unfortunately this article did nothing to enlighten me - it has some pretensions of being philosophical without explaining any of the practicalities. Does anyone use Tw…