Preramble
Next year I’ll hit the 50th anniversary of the first line of code I ever wrote. It looked something like this:
10 PRINT "JIMMY WAS HERE "; : GOTO 10
I fancy that single line, written on my shiny new TRS-80 model 1, marked an early fork in the path of my life, shaping both my hobbies and my subsequent career. Like others in this forum, I’ve lost count of the languages I’ve used and the applications I’ve authored, and I confess: my lifelong immersion in the craft of coding fed a skepticism of, and a disdain for, the use of AI for development. Pfft! Surely no sci-fi-pipe-dream like Claude could compare to my actual coding experience.
But… I’m also not someone to rest on my laurels. Complacency precedes irrelevancy in the world of technology and I actively resist it. So I set out to understand this “AI fad” people are both praising and condemning. To do this, I dug out an old, half-completed project of mine: a working prototype of an Inform 6 precompiler which I set aside when other things caught my interest. This, I thought, is a good, non-trivial test case to explore what LLMs can do, what they can’t do, and what, perhaps, they shouldn’t do.
What follows is the result of that experiment. Though I first thought to discard the output of my self-educating exercise, I’ve since reconsidered. In its current state, it fills gaps in my IF-development pipeline which nothing else addresses well and augments my investments in I6 without requiring me to throw it all away. It provides value to me, so I’m sharing it.
To be clear: The above is about transparency. It is not meant to spark an AI debate. If you have a moral issue with tooling made with AI-assisted coding, then this isn’t for you. Also know that I still have my own personal AI hang ups, which are just mine: I don’t use generated graphics; I don’t use generated narrative; I don’t generate the code for the stories I write. I categorize my IF games as creative efforts, works of art if you will, and that’s where I now draw the line in the sands of my mind.
Hello cognitive dissonance, my old friend.
Announcement
Today I’m sharing an experiment called Beguile. It’s a type-safe language and debugging tool used to create Interactive Fiction for the Z-Machine and Glulx Virtual Machine. It is closely related to Inform 6 but with stronger C-like leanings. Depending on how you want to use it, it acts as either an I6 precompiler or a stand-alone language. It functions a lot like Typescript which transpiles high-level code into lower-level code without reinventing the wheel when it comes to the already-solved problem of byte-code generation.
Beguile augments the existing I6 toolchain; it does not replace it.
What’s With the Name?
Collins English Dictionary defines “beguile” as follows…
Beguile / bɪˈɡaɪl / verb
1. to charm; fascinate
2. to delude; influence by slyness
…and both definitions apply.
1. One of my goals for Beguile was to make it syntactically appealing: symmetrical, consistent, and familiar to those with a background in C-inspired languages.
2. The beauty of the language is itself a mask over Inform 6. All of I6’s plumbing remains intact; Beguile conceals it behind a rich, modern veneer and builds upon it.
Beguile closely resembles I6 and I like to imagine that, in a parallel universe where Captain America served Hydra, Spock had a goatee, and I7 never was, there’s a version of Inform which looks something like this.
A Modern Language
Beguile is a programming language that knows it’s a programming language. It fully embraces the procedural paradigm and provides more modern features than you can shake a stick at: Mutable strings? Yes. Operator overloads? Uh huh. Lambda functions, LINQ-able arrays, floating point numbers? Check, check, and check.
Beguile’s interop-with-I6 is baked in, not as an afterthought, but as a first-class, foundational consideration of the language. You can use your existing I6 extensions, compile games with either Puny Inform or the I6 Standard Library (with or without the orLibrary), and target Glulx, Z5, or Z8. The i6-interop is soooo foundational that, ironically, writing Beguile is optional when using Beguile. There are three conceptual tiers of adoption:
- Write vanilla I6 with Puny or the I6 Standard Library; no Beguile at all. I feel like this misses the point, but you do get the VS Code debugger and can step through your code as it runs. No small benefit, IMHO.
- Use Beguile as a precompiler. Same as the above, but you can inject “Beguile islands” (little snippets of Beguile code) into your I6 wherever it makes sense.
- Reverse the above: use Beguile as your work’s primary language, with bits of I6 injected if needed. This is where the full power of the language comes into play.
More Than a Language
There are two sides to the Beguile coin which deliver on its promise: Beguiler is the Beguile compiler and language server; Beguilex is the Beguile extension (for VS Code). These work together to provide language colorization and run-time, step-through-your-code debugging.
Beguiler also includes a built-in Blorbifier.
I’ve already posted a teaser of this in another thread, but here’s quick a screen shot of a debugging session paused at a breakpoint while running Cloak of Darkness…
Use of Other’s Works
Beguilex weaves together open-source efforts from talented people, specifically JavaScript interpreters, plus the various technologies which underpin these. Beguiler makes use of the Puny and Standard I6 libraries, as well as the I6 compiler. Care was taken to NOT branch, nor modify these code bases. The authors’ works remain untouched.
Project Maturity
This is experimental. It’s an early preview which I wanted to get out because it provides useful enhancements to the I6 pipeline; however, it is not battle tested, and is bound to have rough edges. These will smooth out over time, but the project’s applicability today isn’t theoretical: I’ve ported “Cloak of Darkness” and two of my own works, “Monkeys and Car Keys” and “the Wade Wars, Book III” to the language, plus I have new works-in-progress being built on Beguile from the ground up. Even so, I can’t in good conscience call this anything but an Alpha. Let’s say… “version 0.1.0 preview”.
Getting Started
If you’re up for it, you can download Beguiler and Beguilex from their GitHub repos.
There’s also a quick start guide, and if the directions in it are not clear or fail to address the obstacles to getting you up and running, please DM me so I can help, and update the doc for other users. I confess to you now: there’s a fair amount of “Works on My Machine” going on here so I’d love for people other than me to take a look at it and tell me where it fails them.
The Beguile for the I6 Developer guide is specifically targeted for this audience. I’d like your thoughts on this particular document, specifically around what would help bridge the conceptual gaps standing in the way of adoption for someone with an I6 background, and your input on the things you do in Inform 6 but aren’t sure how to accomplish in Beguile.
Beyond those docs is the full language spec. As a rule, such references can be dry, and this one’s no different, but there is one for those interested in that sort of thing.
I hope this project is useful to others. If you find this project compelling and have constructive feedback, please drop me a note.
Thank you.
-Jim

