Tuesday, April 05, 2011

PyCon: Ten Years of Twisted

Ten Years of Twisted

The talk was by Glyph Lefkowitz, the original author of Twisted.

He mentioned Medusa and Sam Rushing.

Twisted started because Glyph wanted to add email and HTTP handling to his video game, Twisted Reality. He started by using the "select" function call.

Twisted is good because it unifies the protocols.

Glyph is only the 3rd most prolific Twisted committer.

When you write tests for Twisted code, you can have both the client and server in the same process.

Twisted is event-driven and asynchronous.

Before switching to Python, Glyph wrote Twisted Reality in Java using threads.

Twisted is powerful and flexible.

Twisted is switching from the term "framework" to "engine".

"Reactor included."

Use "twistd --help" to see which servers are available for free with Twisted.

Glyph said, "I hope we have another 10 years of Twisted."

Side note: Gevent was really popular this year. During his keynote (which I missed because I overslept, unfortunately), Guido said that he rejected the "everything is a callback approach". However, he also said he didn't like approaches using Greenlets because you couldn't be exactly sure where the context switches were happening. I know he also doesn't like threads. He seems to prefer explicit yields for asynchronous IO. As far as I can tell, many Python programmers aren't following his suggestions because Gevent seemed really, really popular this year. It's certainly my favorite approach for asynchronous network servers.

No comments: