Saturday, February 11, 2012

Three Valentines to Inform 7 Hackers

Inform 7, while a great tool for creating interactive fiction, has always lacked some of the testing and debugging features that programmers in other languages can take for granted. Several exciting new developments this week will go a long way towards addressing these problems.

Brady Garvin (better known in the community as EmacsUser) announced the Interactive Debugger extension, which incredibly adds a whole debugger to a Glulx Inform 7 project, with support for breakpoints, printing a detailed call stack including the built-in Standard Rules, and interactively showing executing code at the Inform 7, Inform 6, and even Glulx assembly levels. There's even PDF documentation.  The extension is built atop an impressive new infrastructure of behind-the-scenes extensions collectively called GRIP (Glulx Runtime Instrumentation Project) which themselves offer a whole new level of access and control into the complex internal workings of an I7 project. The whole works is still in beta form; the author would appreciate your comments and bug reports over in this thread on intfiction.

A second extension, Benchmarking by Dannii Willis, gives I7 authors a way to pinpoint slowdowns in their code and compare different algorithms against each other. As a high-level language, Inform 7 can sometimes make it too easy to write inefficient code which will cause slowdowns especially on mobile devices or Javascript interpreters. Many authors working on extremely large or complex projects (myself included) have in the past spent many tedious hours trying to increase execution speed through trial and error. The Benchmarking extension gives specific timings down to the resolution of your operating system on how fast a given bit of code runs, making it invaluable for comparing two routines against each other. Also in beta, you can find the thread on Benchmarking at the earlier link.

Finally, in a surprisingly short time Ron Newcomb has completely rewritten Inform 7's parser in Inform 7. A key component of the underlying system, the parser handles the difficult task of deciphering the player's commands. One of the oldest pieces of code in the I7 ecosystem, the parser is famously written in monolithic blocks of  Inform 6 that are tricky to decipher and even more difficult to modify. The new version breaks things up into smaller chunks with human-readable variable names, not only making for smoother parser-delving but also much easier customization of the parser's behavior. The link above goes to the latest version of the (also in beta) extension; you might check Ron's blog to find future updates.

I'm not sure whether Ron, Brady, and Dannii intentionally timed these releases as an early Valentine's Day gift to IF authors, but they definitely deserve all the candy hearts they can eat this week.

No comments: