Mark Sample
Davidson College
In this assignment, students work with HTML, CSS, Javascript, and JSON templates in order to design a website that generates new content out of pre-established rules and word banks. No prior coding or web development experience is required; the free browser-based platform Glitch.com hosts the projects templates as well as the projects themselves. The assignment encourages students to deconstruct the underlying rules, tropes, and conventions of any kind of textual genre. This assignment emerged out of an undergraduate course devoted to digital literature and poetry, but it can be adapted for many contexts, including any field concerned with form, style, and genre conventions.
Learning Goals:
Original Assignment Context: Middle of elective digital studies course
Materials Needed: Web-based HTML, CSS, Javascript, and JSON templates (linked in assignment), a free account on glitch.com
Time Frame: ~4-5 weeks
Introduction
Deconstructing and Reconstructing Genre and Form with Tracery is an assignment in Digital Studies (DIG) 220: Electronic Literature, a course in the Digital Studies program at Davidson College. DIG 220 surveys the past and present of interactive narrative, digital poetry, and hypertext fiction—collectively known as electronic literature, or e-lit. Given its focus on narrative and aesthetics, the course also counts for the English major and minor at Davidson College. The class draws a mix of students, ranging from English majors who have never coded in their life to Computer Science majors who are more comfortable with Python than poetry. In between are students simply seeking to fulfill Davidson’s Literary Studies, Creative Writing, and Rhetoric “Ways of Knowing” graduation requirement, our version of a literary-oriented general education requirement. The class size is typically 25-30 students, representing every year from first-year students to seniors. I’ve taught the course three times over the past few years, and I’ve used this particular assignment in the past two iterations of the courses. I also use a variation of this project when I teach creative coding workshops for grad students and faculty. Which is to say, the project works well at nearly every level.
Most electronic literature courses follow one of two organizational models. The first model is chronological, marching through digital poetry and narrative of the past half century. This model is often teleological, suggesting that early “primitive” works of digital literature eventually gave way to more complex contemporary works, a notion that doesn’t strictly hold up. The second model is platform-based, which tends to stress technological affordances of tools like Storyspace, Inform, Flash, or Twine at the expense of other aesthetic values. The organizing principle of my course eschews both chronology and platforms. Rather, the course is organized around broad literary and aesthetic themes, such as the uncanny, the sublime, or dysfunction. This organization puts e-lit works from entirely different eras and modes of production into conversation with each other. Furthermore, it actively undermines any technological determinism that my students—and honestly, I—might bring to the material.
Students tackle the Deconstructing and Reconstructing Genre and Form project in a unit on randomness and variability. It is here we delve into the history and power of combinatory writing, which mashes up texts with a degree of randomness, yet is still constrained by a “grammar” or controlled vocabulary. By this point in the semester, students will have encountered digital poets such as Allison Knowles, Nick Montfort, Stephanie Strickland, Amaranth Borsuk, and others who have produced profound work using what at first glance seems to be Mad Libs on steroids. That is, a template or scaffold of syntactical structure the blank spots of which are filled in procedurally with words and phrases curated by the writer/programmer.
Anyone familiar with Mad Libs knows that this kind of combinatory writing lends itself to parody, satire, and outright absurdity. Yet, combinatory writing is also a powerful tool for understanding how genre and form work. Pick any genre of short form nonfiction —horoscopes, menus, movie recaps, medical bills, emails, diaries, and so on—and one finds certain rules, tropes, and conventions at work. In order to make an approximation of such writing convincing, one must study the form, breaking it down to its constituent parts and diving deep into its underlying rhetorical, paradigmatic, and syntagmatic strategies. This is the deconstructing part of the assignment. Without a doubt, taking apart a text is the best way to figure out how it works. This is doubly true when it comes to genre writing. This approach to understanding texts is heavily influenced by Jerome McGann and Lisa Samuel’s concept of “deformance,” a portmanteau of performance and deform. For McGann and Samuels, a deformance is an interpretive strategy premised upon deliberately misreading a text, for example, reading a poem backwards line-by-line. As Samuels and McGann put it, reading backwards “short circuits” our usual way of reading a text and “reinstalls the text—any text, prose or verse—as a performative event, a made thing” (Samuels & McGann 30). Reading backwards revitalizes a text, revealing its constructedness, its seams, edges, and working parts. So too does trying to recreate formulaic writing through procedural generation.
As I said, procedural generation lends itself to parody. For example, creating an endless procedurally generated horoscope that makes fun of the tropes of horoscopes is a rather simple matter. More difficult to achieve with procedural generation is writing that evokes genuine emotion or narrative insight. And this is ultimately what I challenge my students to do: produce generative writing that offers insight and critique. Our goal is not merely to create a procedurally generated text that is funny or absurd, but to create procedurally generated texts that take a stance, point a finger, examine the world.
To that end, students work on a generative text project using Tracery, a Javascript library that lowers the barrier to creating with the “slotted” technique of combinatory writing. Here is the general flow of the assignment:
Generally students have several weeks to work on the project, including at least one day in-class, where I can help troubleshoot problems or push students out of their comfort zone with CSS and HTML. Because the students work in glitch.com, their projects are easily shareable, and we’ll have a brief show-and-tell at the end of the project where they share and critique each other’s work.
Goals and Outcomes
This Tracery project serves several learning goals. By the end of the project, students will be able to do the following:
Materials Needed
The work for this project can be done entirely in any modern web browser, such as Chrome or Firefox. Students will need a free account on glitch.com.
Acknowledgments
There are three foundational inspirations for this project. First, the work of Lisa Samuels and Jerome McGann: “Deformance and Interpretation” from New Literary History, vol. 30, no. 1, Jan. 1999, pp. 25–56. Second, the creative and pedagogical work of Nick Montfort, who advocates for what he calls “exploratory programming” and who makes his own work open and available for remixing, adaptation, and reuse (see Montfort’s open access edition of Exploratory Programming for the Arts and Humanities, second edition, published by MIT Press in 2021). The third inspiration is more theoretical: Sianne Ngai’s concept of stuplimity, which she describes as a “mixture of shock and exhaustion” in the face of stupefying quantities of more or less the same thing—an aesthetic quality that applies to many procedurally generated combinatory texts (see Ngai’s Ugly Feelings, Harvard University Press, 2005). And of course, this project would also be impossible without Kate Compton’s Tracery library and Allison Parrish’s port of Tracery into Python.
Overview
For this project you’ll use a variation of the “slotted” technique of combinatory writing. This means building sentence templates with empty slots for nouns, verbs, and so on. A program then randomly selects from pre-selected lists of words to fill each slot. Think of procedural generation as Mad Libs gone crazy. Tracery is the procedural engine you’ll use. It’s a Javascript library by Kate Compton that lets you create surprising configurations of texts out of the template (called “grammar”) and vocabulary you provide.
Strictly speaking, this project does not involve programming. It does, however, require procedural thinking. Every Tracery grammar takes the form of JSON data. This is a highly structured text format that both humans and computers can “read”—though parse might be a better word. Your grammar data file tells Tracery what your templates are (templates in the plural because you can embed templates within templates recursively) and provides the vocabulary for Tracery to use as it fills in the templates.
The Tracery grammar JSON that powers Don’t Drink the Water”
It’s easy for text generation to be comical or satirical, like Nora Reed’s thinkpiecebot or Compton’s Night Vale Generator, both of which use Tracery. Other text generation parodies powered by tools similar to Tracery include the Postmodern Essay Generator and Eric Drass’s machine imagined art.
It’s also possible to make text generators that are serious or provide social critique, such as my own Infinite Catalog of Crushed Dreams or Leonardo Flores’ Tiny Protests bot, which both use Tracery or Tracery-like tools.
Guidelines
More Details on Editing Tracery
Criteria
DIG 220 uses an assessment method called specifications grading. In specifications grading, expectations for projects are clearly laid out, and you either meet the criteria or you don’t. If you don’t, you’ll have an opportunity to revisit the work and revise it so that it does meet the criteria.
These are the minimal requirements for the project to be considered for a B-range grade.
To be considered for an A-range grade, you project must meet the above criteria plus the following:
Key Modifiers in Tracery
Validating Your Grammar
Pasting your grammar JSON file into https://jsonlint.com is a good way to quickly find missing or extra commas, brackets, or quotations that will screw up Tracery.
Your grammar is everything between the two curly-que brackets: { }
But in order for index.html to load you grammar you need to make sure your grammar file itself has the line
var grammar =
at the top. Then the curly que brackets and everything in between should appear.
Common Errors
Tutorials and Tools
There are a host of Tracery tutorials out there, but the best are the following:
Some useful tools include:
Possible Secondary Sources
In addition to Scott Rettberg’s Electronic Literature, here are some other sources you might want to consult as you work on your Artist’s Statement: