Memeventory! Inventomeme? Uh, how about "inventory meme".

A long time ago — when these sorts of things were still a going concern commercially, if that dates it for you — I remember debating the "realism" of interactive fiction (at the time, "text adventures"). A key point in the discussion was the kleptocratic structure of the game. I wish I could remember this better. For example, I wish I remember who I was talking to. I do, however, remember the critical line, "no actual adult walks around with a bag full of that much crap". I was reminded of this by Paul Swartz describing the contents of his bag. A typical "adventurer" will have at least a dozen small trinkets, gewgaws and baubles on their person at any given time. These are critical work their way out of whatever jam they happen to be in at the moment. Memorably, sometimes they will also be carrying maple syrup, masking tape, other people's passports, and cat fur.


Granted, I don't have any syrup on me at the moment. I do have a few other bits of technological detritus on my person; more, I think than the average adventure-game protagonist. Now that I'm an actual adult, to win this at-least-a-decade-old argument with someone I can't even remember, I'm going to prove it — and you're going to help me do it!


Okay, okay. You came here to memeplex the blogosphere or whatever the kids are calling it these days, not to listen to me ramble about text adventures or my vindictive streak. So here's the idea. Get ready to head out of your house, office, or apartment — wherever you happen to be reading this post — and then take an inventory of your personal flotsam. Then, post it to your weblog in the style of an adventure game. In true Glyph style (i.e. more complicated than necessary), I used Imaginary to assist me with this task. In order to see the list below in all three of its glorious colors, you'll have to grab the code from launchpad as well as figure out how to set up its dependencies.


Without further ado, here it is:


You are carrying:
a digital watch
a bluetooth stereo headset
a grey messenger bag
the grey messenger bag contains:
a mobile phone
a black macbook
a macbook MagSafe(TM) power brick
a small orange microfiber cloth
a mini-DVI to VGA adapter
a beige graph-paper notebook
a 4' USB mini-B to A cable
a wallet
the wallet contains:
a borders rewards card
a boloco frequent burrito-er card
a $35 in cash
a CharlieCard (TM)
a Massachusetts driver's license
a fortune from a fortune cookie
a keychain
the keychain contains:
a samsung MicroSD-HC reader
the samsung MicroSD-HC reader contains:
a 1GB MicroSD card
a RFID building key
an apartment key
a car key
a mailbox key
an office outer door key
an office inner door key
a shaw's rewards card
Rather than the usual fixed number of additional participants, I'm going to say that you can tag one person for each container in your list. I've got 4 (wallet, messenger bag, keychain, microSD reader), so I will tag radix, tenth, exarkun, and washort.

You get bonus points for generating the list using a program, double-bonus points for using Imaginary and quadruple-bucky-points for resolving an Imaginary ticket while you're at it. This goes for everyone tagged by this meme, not just my tag-ees.


If the resulting score increase causes you to gain a level, I will notify you by e-mail.


(Apologies for the repeated edits. Blogger seems to have a problem with <pre> tags HTML everything.)

Structured Python Editor

If you're not already familiar with Subtext, you should probably watch this video to learn about it.

I'm not a big fan of the Subtext programming model. But it does convey one idea that I really, really like. Programs are structured data. This is a very powerful idea, and I think it's a pity that it hasn't really caught on.

Most programmers subscribe to the idea of model/view separation; this phrase has especially come back into vogue with the popularity of systems like Django and Rails. But programmers are only a fan of this as far as it comes to "end-user" applications. For our own tools, rigidly gluing the model to the view (and both the model and the view to the persistence format, execution model, and innumerable other details) is the order of the day. Indeed, Python's own popularity is due in large part to the relative beauty of its syntax.

One of the problems this causes is a language gap. Guido mentioned this in his Py3K talk: different programming communities are already choosing identifiers based on their natural languages. The conflation of real-names and binding-names also creates a more subtle problem in Python: when you want to deprecate a name, let's say, twisted.web.server, you have to choose another name — probably one which isn't as good. If the binding name were, as in Subtext, an internal identifier rather than the user interface accessible to everyone, this would be an easier thing to do. For that matter, a large part of the Py3K effort itself is a change to Python's user interface; if Python were an interactive program with a separated model and view, it would be much easier to change this without changing everyone's code at the same time.

IDEs like PyDev for Eclipse and Wing IDE don't really address the problem of "program as bag of bytes". They provide tools, it's true, but those tools still treat a program as semi-structured information. One of the things you do most frequently in an IDE like this is type some code, which at least temporarily puts your program into a totally invalid state. As you're typing "def ", your module is syntactically invalid. Once you've finished adding arguments, and a docstring or method body it's valid again, but only until you make your next change. If you're using a tool to edit something other than a program, like, say, Inkscape, as you move between different states in your drawing (add a line, change a gradient, resize a shape) each one is a valid SVG document if you were to save it. This is one of the reasons that I don't really use IDEs; despite their features, the core of the experience is still hammering away on a bunch of text files, and for that, it is very hard to beat Emacs.

IDEs aren't the only tools which could benefit from a truly structured interpretation of code. Version control systems, for example, could benefit immensely by having higher level operations. How often do you really want to know "who changed this line of code last"? I don't know about you, but personally, I want to ask questions like "when was this method defined" and "was it ever moved from another module". These questions are difficult or impossible to ask of modern version control systems (even the really good ones).

Another issue with programs being effectively unstructured is that they're not discoverable. If you want to draw a line in Inkscape, you don't need to look up the SVG syntax for drawing a line; you can just hunt around for the "line" button. This is especially important for students, who frequently forget basic things like "how do you define a method" or "what does it mean when a function is outside a class" while learning. Squeak addresses this problem, somewhat: there's still a lot of text floating around, but your program itself is a bunch of objects you can look at.

One of my perpetual second week projects is to make an IDE that understands Python as the serialization format of a graph of objects — modules, classes, and functions — rather than text. This could work on existing Python programs, and it wouldn't need to introduce any wacky new programming paradigms in order to do it: simply treat Python as a runtime and a serialization format, and parse/serialize Python code as if it were any other type of data, like Inkscape does for SVG. Since I'm never realistically going to do it, does anyone else want to? Has somebody else done it already?

The App Engine Of Your Internet...?

I guess Google really does use Divmod as their source for new ideas!

First, as we were implementing our email system, they launched gmail. Then while we were working on VoIP they acquired Grand Central. Now that we're focusing on infrastructure... they've released their infrastructure!

(If you are familiar with Axiom, the appengine database model example should be good for a laugh.)

Of course, I'm wondering: should Divmod, or me by proxy, be worried about this? I think I've settled on "no", for a few reasons:
  1. Google's release of appengine is an indication that this is a hot group of ideas to be working on right now. It sets a precedent for our open source offering to be idiosyncratic. When describing Mantissa's scaling model, I've often heard the objection "But with EC2 I can run whatever code I want!" While that objection is somewhat inaccurate and I can explain with some effort that it's not true, now I have the much snappier retort: "but if you want to use Google's stuff you have to write to a specific API too".
  2. You can't get all the code to appengine, at least for now, so there's a big category of applications that can't use it. We can keep working to address it — and those were really the applications we were already focused on anyway.
  3. appengine doesn't include Athena. It doesn't include Vertex. And it doesn't include Imaginary. There's plenty of fun stuff we're working on outside the realm of simply deploying a web app.
All in all, I'm thrilled that AppEngine is in Python. I hope that we'll be able to get Twisted into the mix at some point, but there's always the possibility that we'll need to integrate with anything a major player releases, and I'm relieved that this (very) major player has decided to go with something that will be easy for us to talk to.


New Blog

Those of you following me on blendix already know this, but I have a new blog.

While I may post something here occasionally from now on, it will be a much more personal flavor; my writing about work, about programming, and about technology will move there.

Masters of the planets (both python and twisted) please update your feed sources; you can feel free to drop this livejournal in favor of the new URL.

Second Week Project

It seems to me that most of my friends are the sort of busy, busy people who always have a half a dozen side-projects which they have the skills but not the resources to complete.

Today, while chatting with such a friend, he mentioned something about a project which, if he had a 2-week vacation, he'd probably be able to get to. After spending a week sleeping, doing nothing, and puttering around, of course, he'd pick up the project in the second week. Of course the likelihood that he would have such a vacation is basically zero, as is the likelihood that the project get done. (Of course, anything can happen, and some things often do.)

I propose a term. This is a second week project — a project that only takes place in the second week of a hypothetical mini-sabbatical. I feel like this could be a useful piece of shorthand for a concept which would otherwise require a few tedious sentences. Am I right in thinking that we all have at least a few of these?