Brussels / 2 & 3 February 2019


Templating Languages for Interactive Fiction

Interactive Fiction, or "Choose Your Own Adventures" games, have been reinvigorated by new, friendly tools such as Twine. Twine and its scripting language Harlowe are a type of Templating Language, where static presentation content dominates, but is modified by small snippets of embedded code. Thus, Harlowe is in the same family of templating languages such as PHP, M4, or front-end web application libraries. I examine the characteristics of truly minimal templating languages intended for non-programmers and demonstrate a toy templating language built with Scheme.

From the point of view of language design and implementation, scripting languages for interactive fiction or visual novels -- such as Harlowe, SugarCube, or Ren'Py -- are interesting in their pragmatism. They hide complexity from the programmer and try to put focus on generating story content. While paradigms such as Model-View-Controller or Model-View-ViewModel tend to crop up in general-purpose programming languages to help manage front-end complexity, these languages mix code and content much like how PHP or HTML+JavaScript was used a decade ago. But by keeping syntax simple, the MVC or MVVM separation of concerns is not necessary.

To keep things intuitive for the non-programmer, they make some interesting decisions about readers, interaction models, procedure definitions, and scoping. These decisions are examined and contrasted with Scheme's standard programming paradigm.


Photo of Michael Gran Michael Gran