ArticleslgStudy

computer science

Inform

Inform is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Inform rather than just read about it. In short: Inform is a programming language and design system for interactive fiction originally created in 1993 by Graham Nelson. Inform can generate programs designed for the Z-code or Glulx virtual machines.

Inform — main illustration
Inform — illustration

Key takeaways

  • Inform belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Inform to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Inform from memory before moving on to harder problems.

Reference excerpt

Inform is a programming language and design system for interactive fiction originally created in 1993 by Graham Nelson. Inform can generate programs designed for the Z-code or Glulx virtual machines. Versions 1 through 5 were released between 1993 and 1996. Around 1996, Nelson rewrote Inform from first principles to create version 6 (or Inform 6). Over the following decade, version 6 became reasonably stable and a popular language for writing interactive fiction. In 2006, Nelson released Inform 7 (briefly known as Natural Inform), a completely new language based on principles of natural language and a new set of tools based around a book-publishing metaphor.

Z-Machine and Glulx The Inform compilers translate Inform code to story files for Glulx or Z-code, two virtual machines designed specifically for interactive fiction. Glulx, which can support larger games, is the default. The Z-machine was originally developed by Infocom in 1979 for their interactive fiction titles. Because there is at least one such interpreter for nearly every major and minor platform, this means that the same Z-code file can be run on a multitude of platforms with no alterations. Originally Inform targeted the Z-machine only. Andrew Plotkin created an unofficial version of Inform 6 that was also capable of generating files for Glulx, a virtual machine he had designed to overcome many of the limitations of the several-decades-old Z-machine. Starting with Inform 6.3, released February 29, 2004, Inform 6 has included official support for both virtual machines, based on Andrew Plotkin's work. Early release of Inform 7 did not support Glulx, but in August 2006 Glulx support was released.

Inform 6

Inform was originally created by Graham Nelson in 1993. In 1996 Nelson rewrote Inform from first principles to create version 6 (or Inform 6). Over the following decade, version 6 became reasonably stable and a popular language for writing interactive fiction. The Inform 6 system consists of two major components: the Inform compiler, which generates story files from Inform source code, and the Inform library, a suite of software which handles most of the difficult work of parsing the player's text input and keeping track of the world model. The name Inform also refers to the Inform programming language that the compiler understands. Although Inform 6 and the Z-Machine were originally designed with interactive fiction in mind, many other programs have been developed, including a BASIC interpreter, a LISP tutorial (complete with interpreter), a Tetris game, and a version of the game Snake.

The Inform 6 compiler The Inform compiler generates files for the Z-machine or Glulx (also called story files) from Inform 6 source code.

The Inform 6 programming language The Inform programming language is object-oriented and procedural. A key element of the language is objects. Objects are maintained in an object tree which lists the parent–child relationships between objects. Since the parent–child relationship is often used to represent location, an object which is the parent of another object is often said to "hold" it. Objects can be moved throughout the tree. Typically, top level objects represent rooms and other locations within the game, which may hold objects representing the room's contents, be they physical items, non-player characters, the player's character, or background effects. All objects can hold other objects, so a livingroom object might hold an insurancesaleman object which is holding a briefcase object which contains the insurancepaperwork object. In early versions of Inform, objects were different from the notion of objects from object-oriented programming, in that there was no such thing as a class. Later versions added support for class definitions and allowed objects to be members of classes. Objects and classes can inherit from multiple classes. Interactive fiction games typically contain many unique objects. Because of this, many objects in Inform do not inherit from any class, other than the "metaclass" Object. However, objects very frequently have attributes (boolean properties, such as scenery or edible) that are recognized by the Inform library. In other languages this would normally be implemented via inheritance. Here is a simple example of Inform 6 source code.

The procedual parts, statements and operators, are largely borrowed from C, with the notable exception that -->x instead of [x] is used to take array subscripts. Routines are defined in square brackets, as in the Main routine above, but called with round brackets as in C. The character @ is used to escape characters and to invoke raw Z-machine opcodes.

Inform 6 library The Inform system also contains the Inform library, which automates nearly all the most difficult work involved in programming interactive fiction; specifically, it includes a text parser that makes sense of the player's input, and a world model that keeps track of such things as objects (and their properties), rooms, doors, the player's inventory, etc. The Inform compiler does not require the use of the Inform library. There are several replacement libraries available, such as Platypus and InformATE, a library that codes Inform in Spanish. Some games may use no library at all, such as a direct port of Zork into Inform 6.

Example game

Here is an example of Inform 6 source code that makes use of the Inform library. The Inform 6 code sample below is usable in Inform 7, but not without special demarcation indicating that it is embedded legacy code.

… excerpt ends here. Continue reading the full article.

Illustrations

Inform: The Inform 7 IDE on Mac OS X showing source code and the skein
The Inform 7 IDE on Mac OS X showing source code and the skein
Inform: The Inform 7 IDE on Mac OS X showing the Index Map and the transcript
The Inform 7 IDE on Mac OS X showing the Index Map and the transcript

Worked examples

Example 1 — a first encounter with Inform

Start with the simplest possible case. Write down what Inform claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Inform before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Inform ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Inform

In research
Inform appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Inform in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Inform is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1993 software, Domain-specific programming languages, Formerly proprietary software, so understanding it makes those chapters shorter.
In everyday life
Look for Inform outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Inform” →

How to study Inform in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Inform means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Inform out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Inform in simple terms?

Inform is a programming language and design system for interactive fiction originally created in 1993 by Graham Nelson. Inform can generate programs designed for the Z-code or Glulx virtual machines.

Why does Inform matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Inform?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Inform.

Tags

  • 1993 software
  • Domain-specific programming languages
  • Formerly proprietary software
  • Free game engines
  • History of computing in the United Kingdom
  • Interactive fiction engines
  • Programming languages created in 1993
  • Software using the Artistic license
  • Video game development software

Keep exploring