On J.R. Carpenter’s “Gorge”, Part One: String Theory


There’s this thing called digital literature. To those of us with a disposition to love physical books, their material essences, the phrase can be alienating, disturbing even. It makes me think of some immense ethereal database, to which novels and poems and plays can be hooked and uploaded, a Matrix of the creative mind. It doesn’t, in those terms, sound particularly appealing, but rather like a vast, crammed forest. It sounds like somewhere you could get lost—not in the exciting, carefree, sight-seeing way, but more in the “oh God this industrial wasteland is nowhere near our hotel and also it’s raining” sort of way.

Fight this fear. Digital lit is really, really neat, not least because it’s so much less interested in uploading Madame Bovary to the Cloud than it is in finding out completely new ways of creating things with words, using technology and programming languages as tools to assist in the endeavour. I’m going to be writing a series of posts exploring one instance of digital literature, breaking it down into its source code, looking at that code, assessing how it works, and finally deciding what it’s worth as literature. If you have never seen computer code in your life before, I urge you not to navigate away immediately; until this summer, I’d never had a proper look either, so I promise you that everything will be explained for the layman, clearly and accurately. (I live with a real live computer scientist, who checks all of these posts for accuracy.) Plus, the possibilities for what you can do with code are literally infinite—it’s expressed in languages just like literature is—so it’s worth your while to know something about what can be done with it.

In 2009, Nick Montfort wrote a program that created a neverending poem called “Taroko Gorge“. (Do you see what I mean about these things being really neat? A neverending poem! Holy shit!) You might think that this would require a great deal of complicated and arcane mathematics and large word banks upon which to draw—not a bit of it. Such are the joys of combinatorics that you don’t actually need very many resources in order to create a large number of variations. It’s likely that, given some complicated and arcane mathematics and large word banks, you could create a more complex, nuanced and interesting neverending poem, and this is a notion worth exploring, but we’ll get to that later. For now, let’s look at the code.

The code I am going to look at here actually belongs to an adaptation of Montfort’s program by a poet and programmer called J.R. Carpenter. (She’s commented on this post, so check out her comment below!) I came across it while looking at a zine called Hack Circus, which I’d recommend wholeheartedly. They describe themselves as an artistic collective interested in “the entertaining and engaging side of inventive thought, whether that manifests physically with wires and batteries, or conceptually in artistic or philosophical ways”—or, as their website tagline succinctly puts it, “fantasy technology and everyday magic.” It’s a playground for the imagination; every article is a jumping-off point for something fascinating and bizarre.

Carpenter calls her iteration of the work “Gorge“. You’ll realise why when we start to look at her inputs: the poem that “Gorge” produces is, yes, about the body and its processes, while the poem generated by “Taroko Gorge” is about the natural world and has a serene, secluded feel to it. But that’s nothing to do with the structures of either poem; it’s entirely down to the words. If you look at their skeletons, these two poems are built the same way, and I’m just not sure that structure should be irrelevant to two poems with completely different emphases. It’s as though Allen Ginsberg’s “Howl” and Marlowe’s “Come live with me and be my love” were written in the same meter and idiom.

On the other hand, both “Leda and the Swan” and “The Windhover” are sonnets about birds, and they still manage to capture their own very different essences in similar forms. (On the other other hand, “The Windhover” is extremely cavalier about meter. You could keep having this argument forever.)

So, Carpenter’s code starts like this:

var t = 0;
var n = 0;
var paths = 0;
var above = 'appetite, brain, craving, desire, digestive juice, enzyme, gaze, glaze, gorge, gullet, head, incisor, intellect, jaw, knowledge, language, maw, mandible, mind, molar, muscle, mouth, nose, sight, smell, spit, sweat, spirit, thirst, throat'.split (',');
var below = 'aroma, bladder, blood vessel, bowl, bowel, crust, dip, dressing, film, gut, lip, lower lip [etc etc]'.split (',');
var trans = 'agitate, attract, bite, boil, braise [etc]'.split (',');
var imper = 'become, confuse, cut, decant, enter [etc]'.split (',');
imper = imper.split (',');
var intrans = 'absorb, age, assimilate, balance [etc]'.split (',');
var s = 's,'.split (',');
var texture = 'acrid, barely perceptible, cautious [etc]'.split (',');

In JavaScript, the programming language that this code is written in, var introduces a variable. A variable in programming is just a thing that gets assigned a value. We’ll worry about var t, var n, and var paths later; we don’t have enough information about them right now to assess them meaningfully, other than to note that they have all been assigned a value of 0. What we do have is a large amount of information about the other variables, all of which seem to have been assigned multiple different values. But if you scroll to the right, you’ll see that the whole shebang—all of the words associated with, say, var above—are within one set of quotation marks. And what that makes them is one value, because they’re a string. A string is everything inside a set of quotation marks, which all gets lumped together and treated as one. So, for instance, ‘appetite, brain, craving, desire’: the program will treat that list of adjectives as one value for our variable, unless told otherwise. What tells it otherwise is the piece at the end of each line, .split (',').

What .split (',') does is split up the string (hence the name; everything in programming has or should have an eminently reasonable name) into an array of substrings. The advantage of writing like this is that it prevents the programmer from having to type out a whole bunch of quotation marks (like, ‘appetite’, ‘brain’, ‘craving’, ‘desire’ and so on). The advantage of making an array of substrings, instead of one massive string, is that now, in theory, we can choose any one of those substrings to be the value of our variable above.

Next up: How we choose a substring, and what happens after that.



16 thoughts on “On J.R. Carpenter’s “Gorge”, Part One: String Theory

  1. The poem is really cool. Along with the programming, I wonder how hard it was to come up with what words would belong to the various strings and how they would combine? Because that’s where the interesting relationships come from, right? The way the variables combine over and over to create something new. And then it is our brains that finish the rest, giving all the various combinations and juxtapositions meaning. A fascinating way to write a poem. Looking forward to more.

    • Yesssss! This is all stuff I’ll be covering soon–probably in later posts, once I’ve gotten the code analysis out of the way. Glad you enjoyed this installment!

  2. Oh this is so cool, I love that you’re doing it. I knew nothing about Digital Literature until I started my PhD. It’s a big thing at the uni I’m at, there are two researchers leading a pretty cool project on it and I went to a masterclass with a writer who showed us her work. So looking forward to following your pieces on this. (I live with a data analyst who builds websites in his spare time.)

  3. The source code of “Gorge” is *exactly* the same as that of Nick Montfort’s “Taroko Gorge” except for the arguments which I swapped out one afternoon as a joke for Nick, who is a friend. Lots of other people have done the same. I changed the source code a bit for “Whisper Wire” but not significantly. In other work I have massively altered source code written by Nick. I wrote about that a bit here: http://nt2.uqam.ca/en/cahiers-virtuels/article/translation-transmutation-transmediation-and-transmission-transmission

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s