A playful live coding practice to explore syntax and semantics
Three of the nights of the Dagstuhl Seminar on Live Coding included performances. Several of these combined live coders with analogue instruments (guitar, piano, cello, and even kazoo), which was terrific to watch.
I found one of their practices fascinating, with real potential for the computer science classroom. Alex Maclean introduced it as “Mexican Roulette,” because they first did it at a live coding event in Mexico City. Live coders take turns (the roulette part) at a shared computer connected to speakers at the front of the room.
- The first live coder types in some line of code generating music, and gets it running. From now on, there is music playing.
- The next live coder changes the code any way she or he wants. The music keeps playing, and changes when the second coder then evaluates the code, thus changing the process. Now the third coder comes up, and so on.
- If a live coder is unsure, just a few constants might be changed.
- If a live coder makes a syntax error, the music continues (because the evaluation that would change the process fails), and the next coder can fix it. You can see the error messages on the right in the picture above, which I took mid-way through the roulette.
- If a live coder makes a mistake (at one point, someone created quite a squeal), the next live coder can fix it. Or embellish it.
What I found most promising about this practice is that (to use Briana Morrison’s phrase for this) nothing is ever wrong here. The game is to keep the music going and change it in interesting ways. Responsibility for the music is shared. Mistakes are part of the process, and are really up for definition. Is that a mistake, or an exploration of a new direction? This activity encourages playing with syntax and semantics, in a collaborative setting. It relies on the separation of program and process — the music is going, while the next live coder is figuring out the change. This could be used for learning any language that can be used for live coding.