Inform is an InteractiveFiction authoring system written by GrahamNelson. Graham's Inform page can be found at:
http://www.inform-fiction.org/
The Inform Programming Page can be found at http://www.doggysoft.co.uk/inform/, although it hasn't been updated since 1996. A better starting point would be Roger Firth's page at http://www.firthworks.com/roger/.
Also see StephenGranade?'s Inform page at:
http://www.duke.edu/~srg3/IFprogramming/inform.html
Stephen is also the Guide at About.com's InteractiveFiction pages:
http://interactfiction.about.com
Inform has a lot of EnglishLikeFeatures. It could also be described as a LogicProgrammingLanguage.
Not really. It's actually a hybrid language, with a lot of neologisms describing some fairly mundane programming concepts, plus some clever stuff:
- It has deceptively English-like syntax (English-like in a similar way to COBOL). It is generally easier to read than write.
- It has a fairly standard object and class mechanism under the hood (classes are called 'kinds')
- Objects have single inheritance
- It has a type system for non-object types (called 'kinds of value')
- Objects can have Boolean properties, property slots, and 'relations' (stored outside the object, but effectively like a multivalue property slot which can be looked up in reverse). Property slots with enumeration type can be used as adjectives to describe the object, and one special slot/type per object can also be used as a special 'state' marker (also used as an adjective).
- All identifier names (of objects, types, classes and procedures) can span multiple English words
- An adjective as part of an object name can mean any one of: object class, 'state' slot, enumeration-typed slot, or custom-defined function
- Non-object types include integers, enumerations, lists, and tables. Lists and tables are strictly typed (no Lisp-like cons cells of mixed types).
- Object classes, property values and relation memberships are described with RDF-like triples expressed in English.
- Lists of objects matching a specification can be retrieved using queries written in English, but these lists only compile to 'foreach' loops.
- Objects do not have methods, instead more complex operations than simple procedure calls are invoked using a 'rule' system which pattern-matches on both global variables and queries over parameters
- There are built-in sets of rules which execute in a specific pre-programmed order. Learning the subtleties of each rule in the built-in library and when it runs becomes very important to programming.
- Rules can be named and named rules (or sets of rules) can be replaced elsewhere in a source file.
- There are global variables and they are often the best way of passing data between procedures. Much of the built-in library behaviour revolves around setting certain global variables.
- There are imperative procedures/functions with local variables, but they are limited to three parameters
- The imperative sublanguage reads very much like COBOL, and like COBOL (or Python) is very much whitespace sensitive - a blank line inside an if/then block will break it).
- Tables are defined in the program source using TAB characters to separate columns and yes, no whitespace there either or it breaks.
- There is a text printing subsystem and a special kind of procedure which can only be run inside text output blocks. Invocations of printing procedures (putting a name inside square brackets) looks visually identical to comments.
- There is a text parsing subsystem based around nouns and verbs, which uses the source code name of an object as its parsing and display name - this is the clever bit which is almost impossible to replicate in any other language.
- it is edited and run within a custom-designed IDE which embeds a copy of the virtual machine which runs it, as well as an HTML generated index of the runtime objects and types. The manual is online and searchable, barely, but not really designed for reference.
- and it all is written to compile down to the Z-machine, a 1970s-era VM designed for a cut-down derivative of Lisp (but almost completely un-Lisplike, with rudimentary objects but no notion of lists, for instance) and aimed at 64 K home microcomputers. (There is a more modern VM, Glulx, with no RAM limitation, but the Z-machine is really what's defined most of Inform's unusual specifications.)
So it's a real mixed bag of a language. Like a baroque steampunk battleship, it's amazing that it runs at all really, and it is very stimulating to see it defy so many design conventions at once - but there aren't a lot of unifying ideas that hold it all together.
Programming in Inform 7 is a mixture of awestruck delight turning swiftly to utter bafflement, frustration, and anger when you try to work out why something you wrote gives inscrutable compile errors. And then resignation as you realise that you will probably never know - at least not by reading the manual - whether the thing you can't do is a bug or a feature.
CategoryInteractiveFiction CategoryProgrammingLanguage