This story is over 5 years old.


If You Build the Code, Your Computer Will Write the Novel

Darby Larson’s new novel, Irritant, takes the utilization of computer generated speech to the next level. Or circuit board. Whatever. The book consists of a single 624-page paragraph, built out of sentences that seem to morph and mangle...
September 11, 2013, 6:55pm

As a person who grew up playing text-based roleplaying games and trolling BBS sites, I’ve always been obsessed with language generated by computers. I remember spending hours and hours scouring the garbled junk text our printer would spit out when it malfunctioned; I felt certain that somewhere in those hordes of symbols and fragments and numbers smashed together, there was a secret underneath, some kind of impossible text hidden from the rest of the world.

Untangling the strange mystery of what machines might be trying to say is an ongoing investigation helmed by literary weirdos. From oulipean concepts that fuse random alterations to human-generated language, to flarf poetry, where a writer mines the internet for errors and random speech, there continues to be a widening array of ways to build something mind boggling out of the most basic elements.


Darby Larson’s new novel, Irritant, takes the utilization of computer-generated speech to the next level. Or circuit board. Whatever. The book consists of a single 624-page paragraph, built out of sentences that seem to morph and mangle themselves as they go forward. It seems at first immediately impenetrable, but then surprisingly and continuously opens up into places normal fictions would never have the balls to approach.

“In something of red lived an irritant,” it begins. “Safe from the blue from the irr. And this truck went in it. Safe. Something of red in it back to the blue to the red. This truck and something extra. Listen. The nearby something extras in front of the truck. The man in front of the truck trampled from front to back safe from the blue. And all this while the man scooped shovels of dirt and trampled from front to back front to back. The other and the clay sighed for something of red. The irritant lay in something of red and laughed.”

If this sounds insane, that’s because it is. But it is also rare, an impossible object given flesh. Its existence is as much of a relief as it is provocative, dense, an irritant in spirit.

Darby was kind enough to answer some questions about his programming and compiling methods for building his computer-related work.

VICE: How did you get into using computer-generated text as a method for writing fiction?
Darby: I do a lot of text manipulation using code as part of my day job, so I guess I've always been aware that certain basic functions exist and are simple to employ if I ever wanted to use them. I'm not interested in using complex code to manipulate text for its own sake, or trying to make a computer be the author of a work. I'm simply interested in tools that can help a writer achieve something that is meaningful for them. My mindset is not that much different from using functions like cut and paste during revision, or using an MS Word search/replace function to change the name of a character everywhere it occurs. We all do these sorts of things without thinking of it as text manipulation. Modern programming languages provide a few more of these sorts of basic functions, such as randomizers (input sentences in order, output sentences in a random order) or reveresers (input sentences in order, output sentences in reverse order). Granted, these sorts of functions aren't useful for most writers. They only became useful for me when I started becoming interested in more experimental literature and the oulipo movement. It provided a method of restriction where textual atmosphere could remain constant, where my creative control of a work could be pushed outside the realm of content, and into the realm of that content's structure.

Can you give me some examples of constraints or rules you wanted to use, and then the gist of how you went about writing the code to generate it?
Sure. Here is the process I went through to create the work “Pigs.” The first constraint was that I only allow myself one sentence structure: [the noun/nouns] [verbed] [with/through/in/on] [the noun/nouns]. So a sentence like "The woman danced through hoops." is valid. The next constraint was to only allow myself a finite set of nouns and verbs to plug into this structure. The sets I came up with were:


- First noun: [Unicorns, Children, The man, The woman, Birds, Umbrellas]

- Verb: [jumped, laughed, danced, slept, fell]

- Preposition + last noun: [through hoops, with unicorns, on tables, in bed]

So now I have a situation where there are only a finite set of possible permutations of this sentence. I wrote this procedure in PERL to extract all possible permutations:

@one = ("Unicorns," "Children," "The man," "The woman," "Birds," "Umbrellas") ;
@two = ("jumped," "laughed," "danced," "slept," "fell");
@three = ("through hoops," "with unicorns," "on tables," "in bed");

for ($a = 0; $a<=$#one; $a++) {
    for ($b = 0; $b<=$#two; $b++) {
         for ($c = 0; $c<=$#three; $c++) {

                 print "$one[$a] $two[$b] $three[$c]\n" ;

Looking at the output of this, it became obvious what I was doing because each sentence changes a word in order of the next permutation. I wanted to mix all these sentences up so it would have a flow that didn't sound like a computer just spit it out. I wrote this wrapper for the randomizer function in PERL to spit out all sentences in a random order:

my @templist = ();
while(@list) {
   push(@templist, splice(@list, rand(@list), 1))
@list = @templist ;

for ($df = 0; $df<=$#list; $df++)
     print $list[$df] ;

So now the work feels better, but still kind of static. I felt like the piece should do something other than just be a list of permutations. I thought it would be interesting to see it all move toward an even tighter constraint, like slowly change all the words in the original set to eventually be just one word. To do this, I just copy/pasted the entire list over and over, each time re-randomizing and search/replacing one word from the set to a variation of [Pig].


Now the work feels good to me, albeit quite long. It is basically moving from sentences like "The man danced with unicorns." to sentences like "The pig pigged with pigs." For me, what's happening is there is a tightening of constraint as the piece moves forward. Like it's closing in on itself. A pig virus that is slowly eating up all the original sentences. But I wanted to see the reverse, or an opening up. To begin with this pig virus but slowly shed it to eventually reveal the original set. I wrote this wrapper for the reverser function in PERL to spit the whole thing out in reversed order:

@reversed = reverse(@list);
for ($df = 0; $df<=$#reversed; $df++)
     print $reversed[$df] ;

And that's how I wrote “Pigs.”

So you kind of set up a system that will spit out a mass of text, and then, almost more as an editor or puzzle-worker than a writer, look for ways to bend that text further? Are you thinking at all of narrative or story building, in any sense, or is it purely sound and image and juxtaposition?
In earlier works like “Pigs,” I was more concerned with developing technique than creating something with plot. The more I played around with these kinds of works though, the more I asked myself, like how can I bend this thing in such a way where characters can develop or a narrative plot can rise out of it. It's tricky because I'm setting constraints so tightly. The relationship between code and language is strange. You have to apply a very tight constraint in order for code to work on it. It becomes formal language. Chomsky has done tons of research on this relationship and “Pigs” is maybe a primitive actualization of his theories.


At some point I began to move away from formal sentence structure because it's just so rigid. The more complex a sentence is, the more complex a code needs to be in order to handle the problems that creep up with conjunctions and prepositions. I hung on to using word sets that slowly change over time as a primary constraint. So now I can inject narrative via the word choices in the sets I use, so I spend a long time just coming up with a word set that I think characters may develop within whatever system I decide to shove everything through later. Works like “Pulse” and “Sack of Oranges” were written without the aid of any code. With those I was relying on my own ability to write in a sort of constrained stream of conscious, continually referring back to a predetermined word set while writing. It loosened everything up a bit so that a plot could begin to surface.

How about Irritant? Did you set out knowing it would end up as a 600+ page novel? Were there constraints you began with that changed as you went on?
Yeah. I wanted to see these kinds of rules applied on a much larger scale. Because of the parameters I'm setting, I always know roughly how long the finished thing will be. My original idea for Irritant was to use a 70-word initial set that slowly changes to a completely different 70-word final set with a one-word change occurring every 4000 words. So 4000 x 70 is 280,000 words total. Irritant ended up being quite less than 280k, I can't remember why. I think I may have decided to quicken the pace a little. If you set parameters too high, at some point the word count becomes impractical. But theoretically, I could build something like Irritant with a word count in the millions.


Irritant's constraints were similar to “Pigs”'s constraints. I wrote the first 4000 words on my own, just stream of consciousness while referring to the word set. Then I randomized that and concatenated it to the original (so now 8000 words) and did one-word substitution on the new 4000, and so on and so on until all 70 words had been substituted. The big difference between Irritant and “Pigs” is that I wasn't starting with a list of permutated formal sentences so word substitution was a bit more painstaking in Irritant. I had to watch everywhere a new substitution took place and clean it up if need be.

What do you find most pleasing about this process of using coding to generate meaning? Is there meaning? Do computers know something we don't?
Using these processes gave me the opportunity to edit from a top-down perspective, as well as bottom-up. It allowed me to consider literature as almost a different medium, one where I'm so distant from the work that my control of it becomes holistic. I become less concerned with sentence level goings-on, which I can leave to code to figure out, and more concerned with how a mass of sentences are flowing and relating to another mass of sentences. So I don't know, maybe I'm just a control freak?

As much as it provides a measure of unpredictability, I don't think of meaning as being intrinsically wound up with the code or living inside the computer somehow. The result is still a work of literature that a human author intentioned and I think the burden of extracting meaning is still on the reader. If a reader discovers meaning in the relationship between two sentences that a code decided to put next to each other, then I think it's meaningful. And extraordinary.

Previously by Blake Butler - Windows that Lead to More Windows: An Interview with Gary Lutz