PyCon (or, why I’m a big geek)

This week I attended PyCon 2007, in part because I love Python and in part because it happened to be local. It was a blast. I mean, not that everyone and their mom would enjoy PyCon, but if you're into that sort thing, it's a blast.

The people there were bright, energetic, and working on interesting problems like the One-Laptop-Per-Child project, automated test, programming pedagogy, Python 3.0 (aka "Python 3000"), etc.

I was really impressed with the progress the PyPy people have been making. PyPy is a port of Python to Python, which at first glance may seem like a silly thing to do since Python is way slower than, say, C. What they've done is developed a subset of Python ("RPython") that they can efficiently compile and they already have a couple of different backends to compile to (C then machine code, .NET). One of their goals is to eventually make it faster than regular CPython. Neat. Also, they already have support for Stackless Python, which is unlikely to ever make it into CPython due to the evil assembly-level hackery it requires in CPython.

A number of talks were about various game-development toolkits that have sprung up for Python, and outside of sessions people were showing off simple games they had developed. By far the most popular was Galcon (shareware; free for the first 3 days). Galcon is a bit like taking Master of Orion 1, with all of the slow development stuff stripped out and replaced with caffeine, sugar, and adrenaline. The game gives you a choice of servers and you play in a free-for-all against everyone on the same server (typically 5 to 9 other players) to conquer the galaxy. A typical game is around 15 minutes. The game fills an interesting niche: a simple-but-exciting 2-D game (popular in the 80's) that couldn't exist in the 80's for lack of fast computer networks. It'd make a great party game, much like Super Bomber Man 2, except everyone would need their own computer. At one point during the conference a bunch of us were playing and one player had his screen up a projector so non-players could watch.

A couple of nights at the conference there were board-game sessions, where I was introduced to Memoir 44, a wargame with a World War 2 theme. The guy who brought it had an expansion set, and we played a 4-players versus 4-players game that took much longer than he promised it would, but was nevertheless a lot of fun (and we fought off those wimpy Americans trying to take our beachfront! *grin*). I also got in a few games of chess, including one game were I demolished a poor guy who was trying to use a standard positional strategy against my off-beat hyper-modern opening.

After the main conference, there were several days of quasi-organized code sprints were people got together and worked to polish off outstanding problems and push the development of Python forward. I worked on putting together a draft PEP for the new I/O system that will go into Python 3, as well a C implementation and unit tests for certain parts of it.

During the main conference, I also pushed forward with a pet project of mine to build a type that looks, acts, and quacks like a regular Python list(), has similar performance to a Python list() when the list is small, but better performance when the list is large (i.e., log(n) for most operations). I had written a (slow) prototype in Python a few months ago. I now have a working and tested C implementation. It's not yet as fast as a regular Python list() for small lists, but I haven't done any performance tuning yet either. I can't afford to put much more time into it right now, but it's mature enough so that I can start using it in my own projects.

Update: I've now done thorough code-coverage (94.11%) testing of my C implementation, with the uncovered code being stuff that only comes up if malloc() fails or you try to put more than INT_MAX elements into the list.


Comments are closed.