[Twisted-Python] twisted.web in 60 seconds...why aren't these on the frontpage of TM.com?
Jason J. W. Williams
jasonjwwilliams at gmail.com
Wed Apr 21 20:53:04 EDT 2010
I guess I am. :)
Honestly, we've used Twisted in my org for quite some time and until I
was forced to use it my view of it was colored by my infrequent
beatings by it and the derisive comments of the primary maintainer at
With the 4 hours I spent actually learning the concepts, Twisted is no
longer a black box...it makes sense. That and I've
optimized/re-factored a bunch of code to work with that theory instead
of against it. Huge benefits.
I'd say the biggest barrier to entry is the documentation. And let's
face it...there's no reason Twisted shouldn't be used by more folks.
It's great...but learning it feels like a frat hazing. That's largely
because reading the docs feels like learning from that comp sci prof
who was smart...but wasn't smart enough to explain the concepts at
Let's take Tornado for a second...right now I'm building a web API for
our services and I'm in platform selection mode. My experience with
Twisted.web's URL dispatching system made me want to cry. Tornado was
a breeze to use. But here's the problem:
1.) There's no good async libraries for Tornado...so if I want to
integrate with Redis or MySQL or anything, I've got to accept that I'm
going to block when it's not necessary and live with that.
2.) Tornado's performance from the the benchmarks I've read is only
between 15% and 30% better than twisted.web.
2 is not enough to justify 1, because let's face it (and yeah I'm
coming to a point) 1 is going to kill your butt often enough to make 2
But because I'm pretty comfortable with Twisted now...it makes more
sense for me to write my own dispatcher that emulates Tornado's than
give up all the rock-hard awesome features and reliability of Twisted.
deferToThread may not be the preferred way of handling a blocking
task...but when you need it, you need it.
...so my point is...Twisted's PR problem is it needs more accessible
docs. They need to be understandable, entertaining...and pretty. It
all starts with that front page...and the web app in 10 lines right
smack dab there.
I'm going to start with the front page...and then I'm going to write
some articles on my blog that are what I wanted when I was learning
Twisted. Hopefully, they'll be of use to someone.
On Wed, Apr 21, 2010 at 6:15 PM, Glyph Lefkowitz
<glyph at twistedmatrix.com> wrote:
> On Apr 20, 2010, at 7:06 PM, Jason J. W. Williams wrote:
> And yes I'm volunteering to reorg.
> Wow, you really are a glutton for punishment, aren't you? :)
> Go ahead and create an alternate front-page wiki page, and let the list know
> when it's ready so we can pile on and critique.
> I'm sure it wouldn't be too hard to do better than what's there, though.
> Looking forward to it,
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
More information about the Twisted-Python