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.
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.
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.