Twisted Python: Sliced Bread, part #2

Posted 12 Mar 2001 at 18:24 UTC by carmstro Share This

Twisted Python began as just a Python implementation of Twisted Reality; a framework for multiplayer text-based interactive fiction. Having previously had experience mostly with Java and C++, I was amazed by the amount flexibility and self-awareness that Python had. When a 20,000 line project went to approximately 3,000 lines overnight, and came out being more flexible and robust once it had been completed, I realized I was on to something really good. --Glyph Lefkowitz

Programming is fun; but programming is *more* fun when the classes of problems that you're not interested in solving don't get in the way of those that you are. Twisted Python uses the Python object model and module mechanism extensively to provide a set of orthogonal (although occasionally interdependent) services to all interested programmers. It is a repository of Python code to which a few people contribute, which will continue to be maintained as a research project for years to come.

There are many parts of Twisted Python, I'll give a summary of each part.

  • Twisted Reality - This is where it all started. An interactive fiction engine mainly for text-based games. We are discussing how plausible it would be to fit a spatial/graphical RPG into Twisted Reality. Whether it fits into T.R or not, I (Chris Armstrong) definitely want to get a spatial RPG engine into Twisted Python.
  • Inheritance - An actual game utilizing Twisted Python. An interesting aspect of it (and Twisted Reality) is that it can be either single OR multi-player.
  • Twisted Net - The heart of it all, this is the most-used module within Twisted Python. It started out as a CORBA replacement, but glyph factored the RPC part of it out into GLOOP (The Generic List and Object Oriented Protocol), and the networking code into Net.
  • Twisted Web - This started out as just a web interface for Twisted Reality-based games, but it has grown into a quite passable web server (and a *very* interesting and easy-to-setup one, at that). There are already at least 4 people using it for their personal web sites.
  • Kimchi - This is a persistence framework utilizing Pickle. The reason we don't want to use the ZODB is that it puts too many restrictions on client code, and Kimchi tries to absolutely minimize that. This still needs concurrence support.

There are also several support modules, including a command-line parser (usage), an interesting dbm-like interface to a filesystem (dirdbm), and many others.

If you're interested in any of this, I'd highly recommend checking out the Philosophical tutorial to Twisted Python. It shows just how cool some of this stuff is.

Twisted.Web is great, posted 12 Mar 2001 at 21:06 UTC by Bram » (Master)

I created Soko, a very dynamic web game using Twisted.Web. It's been a joy to work with, and I have a very featureful site after only a few days's work.

It looks very good, posted 12 Mar 2001 at 21:10 UTC by splork » (Master)

A coworker (bram) gave me a pointer to the 0.7 tarball of Twisted Python. I was mostly interested in the comms layer but found myself reading more and more. It looks like a very good architecture for designing a network base application on. If this had existed 9 months ago, we probably would have used it for mojo nation rather than the asyncore and custom event queue based system we currently use.

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

Share this page