Inform: Past, Present, Future
emshort.com
emshort.com
- Inform is a language for writing interactive fiction. Inform 7, the current version, is also a really fascinating declarative programming language. Its quasi-English look appears to be just syntactic sugar at first glance, but there's more going on than you might think.
- Even if you're not interested in interactive fiction, per se, this is a really good, thoughtful presentation on programming languages in general from Inform's creator, who is a mathematics fellow at Oxford and an award-winning poet. (It is not surprising at all that he appears to be friends with Donald Knuth.)
Guess the verb and satisfying the parser is a time-honored part of playing interactive fiction; I'm not really sold on the idea of it being a core part of authoring it.
This S-V-O+adjoints structure is also what deals with one of rule systems biggest hurdle; namely the ordering of these rules. Most of the time I7 works by selecting the most specific rule for the subject/verb/object at hand and execute only that one. Surprisingly (but also because it's tightly coupled to the specific domain of inform (interactive fictions)) it works exceedingly well and only very rarely gets the order wrong.
Since Inform 7 also structures rules/functions through Actions and Activities, in sequential stages (which either work in "execute the most specific rule" mode or "execute all the rules that match" mode), you basically get a finer form of aspect oriented programming in that Inform7 does not rely on methods from some subterraneous object oriented world, it's pure declarative decoration all the way down. In the end this gives a very different feel about the way functions or procedures or rules, namely basic blocks of computation can be thought of. What's very special to Inform 7 is that functions are not conceptual atoms nor black boxes. They are composed of smaller, public elements called rules. And they are agnostic to any polymorphism, dispatch or type system functions are usually tied to: Inform 7 delegates these matters to their constituting rules.
And this is a dream when it comes to modelling business logic, because it gives a common "mental space" so to speak to code that would have been spread throughout the codebase otherwise.
There is a lot to be said about those conceptual aspects of Inform7, but presenting it as a looks-like-english language is not enough. It's also a think-like-english language at the syntaxic level of what a language is : our friend Chomsky would argue that it's the kind of syntax for which we have dedicated hardware (gpu accelerated so to speak). Without it, Inform7 would probably be incredibly hard to grasp.
In short: Inform7 and its rule system is one of the best programming encounter I ever had at the conceptual level (and I'm a lisper), but frankly, writing it, getting english to be just like Inform's version of english is nightmarish.
To wander down further tangential space, I did briefly wonder at a past job if I7 would have been a good fit for the basis of a business rule engine. At the time the answer was "absolutely not" because there was no way to embed the language, or a subset of it, in another platform and bend some of the IF domain assumptions.
Some of the work in modularizing the tools in the last couple of years seems to head in the direction that it is close to getting technically possible. There's still the problem that I7 is still not "perfect" for non-technical users (rules list oddities like indents and semicolon punctuation) and more importantly that performance guarantees with the I7 rule engine are hard.
I7 itself can work around the performance issues because it typically has complete knowledge of the domain world model at compile time and can memoize a lot of things at compile time and/or shortcut them at run time. If you were to try to build a business rules engine based on I7 you'd have a lot of fun trying to remove all the potential footguns that start to resemble the classic "paradox rules" to take down the system just like every other Shatner-era Star Trek episode.
It does make reading the source of an IF game really intuitive though. You can basically hand your (structurally finished) game to a writer and they can edit/extend it.
Awwww :-D
This made me laugh for some reason. I guess everyone needs their hobbies.
It's also really cool because it looks like someone could hook this thing up to ray tracer or modern game engine and render dynamic myst style scenes with it (but with NPCs and significantly more detail in manipulation).