By Shamus Posted Thursday Aug 17, 2006

Filed under: Programming 16 comments


James Lileks tries out Inform, a software tool that lets you make interactive fiction, or “text-based adventure games”, in the gamer’s vernacular. Inform is said to be “based on natural language”, which caused me to raise an eyebrow, Spock-like, the moment I read it. Interactive fiction is still a game. The player does things, and the game world is altered in some way. They continue to alter the game world until the story reaches its conclusion. This sort of thing requires some sort of branching logic. If the player goes left, they end up in the library. Right, and they go to the observatory. Go down into the basement and get eaten by a grue. Whatever. There is no way around this: You need some sort of logic to govern this, and that means you need a programming language. This “based on natural English” stuff sounds like Inform is making promises it can’t keep, that the would-be author can program without learning a programming language.

James gave it a try. He wrote a short introductory paragraph and told Inform to do its thing. Here is how things went for him:

You've awakened in a dark hole. You cannot tell what smells worse - you or the pit you're in. The floor is hard, but you can see the sky; it's either twilight or dawn. You've no idea.

Not exactly interactive fiction style, I know, but it's been a while. I asked the game to process what I'd written, and it came up with the following error messages. It's like remarks on a freshman comp paper from a brilliant grad student who completely fried his brain with acid:

Problem. You wrote 'You've awakened in a dark hole' : but I can't find a verb here that I know how to deal with, so I am ignoring this sentence altogether.

Problem. You wrote 'You can't tell what smells worse - you or the pit you're in' : again, I can't find a verb here that I know how to deal with.

Problem. The sentence 'The floor is hard, but you can see the sky' appears to say two things are the same - I am reading 'floor' and 'hard' as two different things, and therefore it makes no sense to say that one is the other: it would be like saying that 'the chalk is the cheese'. It would be all right if the second thing were the name of a kind, perhaps with properties: for instance 'Dairy Products School is a lighted room' says that something called Dairy Products School exists and that it is a 'room', which is a kind I know about, combined with a property called 'lighted' which I also know about.


Problems occurring in translation prevented the game from being properly created. (Correct the source text to remove these problems and click on Go once again.)

Noted, pal. Delete from drive.

I don’t blame him for being irritated. I gave inform a try myself. It turns out you can’t just throw down some prose and expect a computer to intuit what to do with it. You have to define things as a “room” (which is any place, room-like or not, such as ‘Jail Cell’ or ‘Baseball Field’), an “item” (something that can be picked up) a “door” (something that connects two rooms) or a “container” (something which may contain items, which may or may not be openable and may or may not be locked). There are these distinct types of things. You define them and describe them in certain ways. If you fail to describe things the way Inform expects, it will fail and will not be able to turn your text into a game.

Programmers will instantly recognize this process: It’s called compiling. It’s the process that takes your computer code and turns it into an executable. If you do not follow the rules of the programming language you’re using, the compile will fail and the compiler will give you an error message instead of making a game. This is exactly what happened to James.

So Inform is sort of trying to pretend that it is not using a programming language. This “based on natural English” is misleading at best, sophistry at worst. It is using a programming language, but since it is “based on natural English” the rules of the language are murky and the compiler is easy to confuse. Consider:

The key to the computer room is an item. It is on the table. It can be taken. It unlocks the steel door. The description is “a small brass key with well-worn teeth”.

This is how you have to write. Whether or not this is “natural English” is arguable. I’ve never met anyone who talks this way. A human can parse this easily, but the compiler is going to go nuts. It’s going to see “computer room is an item” and think the computer room is an item on a table. It may see “It is on the table. It can be taken.” and think the table can be taken. Should the period at the end of the last sentence go inside or outside of the quotes? Correct grammer says inside, but since that text is echoed back to the player- often in another contex – you don’t really want a full stop there. Trying to write things so as to totally disambiguate your meaning is very hard, and even when done properly the compiler can still get confused. The compiler can misunderstand just about anything. I’m sure once you get the hang of it you’ll eventually intuit what will work and what won’t, but note that in the end it is the author programmer doing the intuiting, not the compiler. The rules must be learned via trial and error.

Let’s compare this to a language I’m going to make up right now:

+declare item:"computer room key"
    unlocks="steel door"
    description="a small brass key with well-worn teeth"

This is what programmers are used to: symbols, assigning properties to variables, indentation. I submit that even for a non-programmer the above is no less readble than what you would need to write for Inform. Yes, it seems cryptic and daunting, but the system has clear rules that can be clearly defined for the programmer and understood. Inform has rules as well, but they are obscured and mysterious. Like a blind man describing an elephant, you must feel around and probe the thing many times until you begin to get a sense of how it is really shaped.

But in the end I think the goal of Inform – which I am guessing is to bring the power of programming to non-programmers – is a noble endeavor which is fundamentally flawed. Certainly there are brilliant people out there who have great ideas for interactive fiction but lack the ability to bring them to life. Putting the power of coding in their hands would be a boon to fans of IF. Currently IF is dominated by various horror and science fiction stories, with the occasional mystery thrown in for good measure. I’m betting this is because these are the sorts of things that programmers enjoy. If non-programmers had a way of realizing their vision, we might end up seeing IF romance novels, coming-of-age stories, character-driven historical fiction, and other things that just don’t naturally come from the minds of coders. As nice as this would be, I don’t think it can be done this way.

Inform tried to allow programming without the use of a programming language, and what they built is programming with a confusing language that has nebulous rules.

UPDATE: I should add: It doesn’t do what users hope it will do, but Inform is nonetheless a very admirable and fascinating project.


From The Archives:

16 thoughts on “Informless

  1. Hale Adams says:

    What? Zork is still out there? Sheesh.

    I tried playing it once in the early ’80s, on my college’s DEC PDP 11/70. (This was when I was learning how to program in Fortran 77, something I haven’t done since, oh, about 1982. Jeez…..) Never did get the hang of it for some reason. I don’t even remember much about the game, except a fragment of a scene descrtiption– something about standing in front of a large building marked “First National Bank of Zork, J. Pierpont Flathead, President”.

  2. Shamus says:

    I never really got into text games either. I sort of missed the boat. By the time I had a machine capable of playing them, they were fading because graphics were becoming common. I did play one: The Lurking Horror. I enjoyed it, but never got very far. It was just too dang hard and I died too often.

    But from what I can see there are people who are still really into IF and really love these games.

  3. Erunaamo says:

    I looked at Inform too. My conclusion: It’s harder to *write* than a regular programming language, as you said. The “natural language” makes it harder to state your intent unambiguously, and it’s wordy. But once the code is written and compiles (thus all the potential ambiguities are eliminated) the “natural language” aspect gives you this one advantage:

    The code is easy to *read*, even if you know nothing about programming. It’s almost 100% self-documenting. A complete novice can read the code and understand what it does, almost completely, and not be put off by weird punctuation.

    That’s possibly a huge advantage for some, a lesser one for many, but it seems like the main advantage of Inform and I’m not sure it outweighs the problems.

    Still, as you said, it’s a fascinating and impressive project. The language isn’t really English, but it’s awfully close, for a computer language, making the compiler an impressive feat even if it still gets confused sometimes.

    Oh, and James was being utterly unfair in the test you quoted. It sounds like he didn’t even glance at the manual, which explicitly warns that the “natual language” claim isn’t exact and spells out the actual syntax. It’s a bit rude to dismiss something as impressive (if flawed) as Inform just because you misunderstand it – like dismissing C because this doesn’t work:

    Hello world;

  4. Roger says:

    > This is what programmers are used to: symbols, assigning properties to variables, indentation.

    You can certainly still use all this if you wish. Here’s your pseudocode fairly literally translated into Natural Inform:

    The computer room key is thing.
    It is portable.
    It unlocks the steel door.
    It is on the table.
    Understand “key” as computer room key.
    Description is “A small brass key with well-worn teeth.”

    That will compile just fine. (Well, almost — Inform needs just a few more things than that. But adding “The Library is a room. The table is in the Library.” will make it happy.)

    Now, it may (or may not) be more common to see this sort of thing in the wild written as so:

    The computer room key is on the table. The description is “A small brass key with well-worn teeth.” It unlocks the steel door.

    Which makes use of some of the default properties and happens to be formatted a bit more like a paragraph. But that’s merely an issue of individual programming style, rather than the language itself.

  5. Roger says:

    (Note with respect to the above — the lines “It is portable”, “It is on the table”, etc — they can be indented as desired. They were, in fact, indented when I wrote the comment, but they got compressed or stripped out or something.)

  6. Miral says:

    Huh. I used to play with Inform a fair bit, but that was Inform 5 & 6, which never pretended to be anything other than a programming language. I found it quite easy to work with, though. I haven’t really had a look at the new syntax yet, but from the sounds of your post it looks a little muddled.

  7. Insanodag says:

    I think the comments against Inform 7, especially as levelled against it by people with a programming background are unfair. While I have some rudimentary programming experience(BASIC, Fortran and Python), the natural language approach to Inform 7 was to me much more intuitive. The language is much better at dealing with ambiguities and lexical imprecision compared to TADS or earlier versions of Inform. I would also like to point out that one of the features of human language is that when used to communicate, they are ambigiuous and confusing, with a simple statement possibly having several meanings. In this sense learning to use Inform 7 is a lot like learning to use a specialised form of English, like legal language or language particular to one academic field.

  8. Jeff says:

    I think it should be recognized that Inform 7 is a specialized language for creating text adventures. Your “programmer’s version” is nice for creating a very simple key, but that’s such a trivial task that it’s silly to use as a basis for comparison. It’s like evaluating programming languages based on the ease of writing Hello World.

    Emily Short has some more to say about Inform here:

  9. TB says:

    I like Inform 7, it is refreshing and, to my mind, has a much shallower learning curve than even BASIC. Also, before people make assumptions, I have a history of programming in Pascal and Delphi, BASIC (RealBasic, VB, QBASIC, Sinclair and BBC BASIC) and a little Java and C++.

    I also learned Prolog as I found that a brilliant language for writing IF. I recomend anyone try it once. Amzi Prolog actually comes with a tutorial/manual which teaches you the language via the writing of a text adventure.

  10. hobbes says:

    I know I’ve missed the boat by an awful long time here, but I had to chip in with my thoughts on your summing up of Inform 7. It sounds as though you’re irritated because the language offers “natural language” processing – and you want this to mean you can write any old thing you want and Inform will still understand.

    That’s incredibly optimistic. It’s still a programming language. There are still conventions and procedures you have to follow. The idea is just that following them is accessible and quick. A measure of quality in interactive fiction is detail. That means adding descriptions of all sorts of items to account for most of the actions the player might like to carry out. Inform makes filling your world with stuff really simple. If I want to let the player look at the sky, sure I could spend 5 minutes creating a new object in your way – I’d rather just write ‘The sky is scenery in The Outdoors. “It is a brilliant, cloudless day”‘ and let Inform’s rules do all the rest of the work, like understanding the player can’t pick it up, or eat it.

    The beauty of Inform 7 is intuition and speed. It still requires understanding of how it works. It won’t take a text dump of Lord of the Rings and make it an IF game.

  11. Shadow Wolf says:

    One of the great advantages of Inform 7 over other computer languages (including those specializing in interactive fiction) is the way it enables you to describe an object or relationship in a natural way:

    The description of a thing is usually “Hm. [The item described] reminds you quite a lot of [a random visible thing which is not the item described].”

    Just imagine what you’d have to write in *any* other language to get “a random visible thing which is not X” – first, iterate over everything in the world, applying visibility rules, eliminate the X, and then pick a random item from the list. Inform 7 writes all this code for you (internally, using the older, more conventional Inform 6 language).

    It’s true that the game programmer, or the library author, could put this in a function. But you could end up writing an awful lot of such functions over the course of a medium to large game, and most of them would be used only once. I7 takes a simple description and generates the code to make it work.

    Other features of I7 allow you to do the same thing – write a simple description which becomes part of a complex piece of code. For instance, most IF games require creating a number of special case behaviors in response to the player’s actions. Generally, this means choosing one of the objects involved, defining triggers in the object, testing to see if the other conditions match the necessary special case, and if so, carrying out the necessary behavior.

    In I7, this can usually be written as a simple rule:

    Instead of throwing a pen at the window in the office after 3:00pm for the third time, …

    I’m a programmer myself, and I’ve worked with a number of other interactive fiction languages. I’m well aware that I7 is a programming language – but it is in many ways far more *expressive* than any of the other languages I’ve worked with.

  12. patrick says:

    Also, the documentation is extremely exhaustive, well written, with examples for nearly everything. It makes no bones over what Inform 7 is – still a programming language, but with a new perspective. It has its quirks, but as a tool to write if it’s really not bad.

    It will NOT serve the same audience that other languages do. I guarantee there will be people who latch onto it who haven’t written IF before. I have used a lot of programming languages and I am pretty intrigued in this. Will it replace those other languages for everything? Of course not. Will it replace everything else for IF for me? Absolutely.

    Being able to lay out a large amount of rooms is better than it could ever be in a text interface. Text substitutions work great. It’s smart enough to keep track of what goes on, so that triggers for any random awkward situation that comes up takes almost no effort to figure out how to describe.

    For the most part, once you have in your head an idea of what kind of somewhat awkward grammar you have to use, the simple things are pretty simple. A lot of complicated things which are extremely hard to do in traditional languages are pretty simple as well. There are a few simple things that are more complex, and there are some complex things that are still complex. But all in all, it works as intended.

    Just don’t expect it to be any more than programming.

  13. Pakman2000 says:

    It’s also important to note that Inform 7 is directed at a very specific community. It is not intended for general use by programmers, and it’s really only intended for a very specific type of application.

    The modern Interactive Fiction community has a large body and conventions and expectations with which all its participants are familiar. If one is familiar with the traditional building blocks of IF, it is quite easy to use Inform 7 to produce a basic working game. It is designed to make implementing the basic elements of a program specific to IF a very streamlined process. It is not intended to be anywhere near as flexible as more general-purpose languages.

    In addition, the IF community is traditionally rife with authors who are not extremely familiar with programming. Inform 7 was largely intended as a friendly way to provide those people with a more accessible authoring tool. Given my own experience with it as a non-programmer, I must say I find it infinitely more approachable than other comparable tools. Learning its grammar is a bit tedious, as it must necessarily be, but the vocabulary is so easy it makes the whole process flow much more smoothly.

    And, as others have said, the documentation is extensive. There aren’t any claims that the language is going to magically understand anything you might think to say to it. James Lileks’ commentary is patently absurd.

  14. Jon H says:

    Lileks’ approach also wouldn’t have worked in an environment in which discussion follows Robert’s Rules of Order or a similar formal idiom. If he walked into a legislature and started rambling, he’d be ruled out of order because he didn’t follow the accepted procedures and protocol.

    Such contexts aren’t using an informal conversational language, but they *are* using natural language. Natural language doesn’t mean “it feels natural”.

  15. Wassabi says:

    I absolutely adore Inform 7. It’s simple, quick and powerful. People just have to understand it’s not C++ or TADS.

  16. WJS says:

    A lot of defenders seem to be saying “it’s easier for non-programmers” when what I think they really mean is “non-programmers are more likely to actually give it a chance”. If all you want to do is throw text at the screen, well, there’s a reason that “Hello world” is typically the first thing taught in any language. Can this actually do anything that, say, C# couldn’t in conjunction with an input-parsing library?

Thanks for joining the discussion. Be nice, don't post angry, and enjoy yourself. This is supposed to be fun. Your email address will not be published. Required fields are marked*

You can enclose spoilers in <strike> tags like so:
<strike>Darth Vader is Luke's father!</strike>

You can make things italics like this:
Can you imagine having Darth Vader as your <i>father</i>?

You can make things bold like this:
I'm <b>very</b> glad Darth Vader isn't my father.

You can make links like this:
I'm reading about <a href="">Darth Vader</a> on Wikipedia!

You can quote someone like this:
Darth Vader said <blockquote>Luke, I am your father.</blockquote>

Leave a Reply

Your email address will not be published.