Improvements for the Inform Language

Published on .

Introduction

Here I am documenting problems of language design and usability that I’ve noticed while using Inform 7 to implement Ryan Quest and Fedoradventure.

Inform 7 (hereafter just “Inform”) is a programming language and game engine specialized for creating interactive fiction (IF), a genre of software which is most commonly known for text adventure games such as Colossal Cave Adventure, Zork, A Mind Forever Voyaging, Photopia, Varicella, and The Hitchhiker’s Guide to the Galaxy. The distinguishing feature of interactive fiction is that it primarily uses text to convey its world and narrative (although many games supplement the text-based core with pictures or sound.) The player types in commands for their avatar, the game logic updates the game world as necessary, and the resulting update is described in text for the player to read.

Despite my grievances here, my overall attitude toward Inform is quite positive. Most of the time it is pleasant to use, and no other game-creation system gives me such a quick design-develop-test loop. I hope that expanding and sharing this page will lead to some of these criticisms being addressed – even if only by myself, in a language extension that only I will use.

Inform code is quite readable even for those who have never encountered it before. However, before continuing, please note that a comment in Inform source code is set off in square brackets, [like this].

Inconsistent Syntax Keywords

You can use either “of” or “from” to express two rooms being linked to each other by a direction.

Room A is a room. Room B is a room. Room C is a room.

Room A is north of Room B. Room B is south from Room C.

However, once you have created such a connection between rooms, only “from” is valid for testing that connection. “Of” won’t work.

[wrong; will not compile] If Room A is north of Room B: do nothing.

[right] If Room A is north from Room B: do nothing.

Wordy Syntax

This code iterates over each element of a list.

let L be the list of muddy rooms;

repeat with X running through L: do nothing.

Below is my proposed replacement. It is shorter, easier to type, is still perfectly good English, is still readable by implementors of all skill levels, and is not – as far as I can recall! – an existing keyword.

let L be the list of muddy rooms;

for X in L: do nothing.