I Got The Inform 7 Compiler Working in a Web Browser!

Hey folks! I just barely got this working, but wanted to share it anyway. :smiley:

I just managed to compile the whole inform7 compiler, including inform6 and inblorb, so that I can convert an inform7 source file into a working gblorb game, and play it, fully in the browser with no installation or server-side processing!

You can test out a very minimal demo here:

https://zicklag.github.io/inform7-wasm/

The source code is on GitHub:

It required a very straight-forward patch to change the return types of indirect function calls to return int instead of void because WASM is stricter about the function call types.

There was a small shim added for some system functions that aren’t actually called I think, but otherwise there wasn’t really much actual porting to do.

I did this over the last couple days with a lot of AI help, but I think it’s pretty close to a very useful state.


I’m thinking I might experiment with a custom web-based IDE for inform. I’m hoping it might be able to make Inform a little easier for people to experiment with and get into. Not having to install anything could be pretty sweet. And I think being able to share web examples that can be tested and modified, and shared with just a link, would be pretty cool!

4 Likes

Web-compiling Inform is indeed cool, congrats on getting it working! FYI there already is a site that offers an online version of the Inform compiler (and several other languages), called Borogrove:

https://borogove.app/

So might be worth taking a look and seeing if there’s anything they do in terms of the IDE setup or other features you’d want to do differently (or even if you want to do things the same way, since of course we’re all doing this for fun :slight_smile: )

2 Likes

Yeah, thanks for the link! I found that earlier and thought it was pretty cool.

My work right now is making a somewhat Discord-like group chat application that also has features for long-term community resources like wiki pages, events, etc. and I was thinking it would be really neat if I could put inform right inside it so that people could collaboratively work on stories like a wiki maybe.

We’ve got so much other stuff to do that’d be a ways out, but it’s pretty fun to think about the possibility.

1 Like