WebKit for Gargoyle

Belated update: I’ve taken a few swipes at adding an HTML parser to Gargoyle behind the scenes, and I’m not excited about continuing down that road. Partly because I’m still putting off that text buffer rewrite, and partly because I can’t muster much enthusiasm for retrofitting the code with a standards-based layout engine.

I took a closer look at the much-maligned HTML TADS code and found a lot to like. Its parser and layout engine are both implemented in a reasonably platform-agnostic way, and QTADS has demonstrated that a non-Windows port is perfectly viable. My main objection now is that it lives on the wrong side of the API: rather than using Glk calls to display the output, it would primarily depend on Gargoyle’s internal, platform-specific pseudo-API.

Meanwhile, the most recent draft for Glk CSS suggests that interpreters will need to host WebKit or something like it to provide authors with the most capable, feature-rich implementation. If WebKit inclusion is the end goal, I may as well go for the gold from the start.

One of the planned features in TADS 3.1 is the ability for a story file to target a web browser for output. If Gargoyle were to bundle WebKit, it could host a browser instance for TADS as well as Inform. That would put the library exactly where I want it to be: capable of offering the full range of output effects for both major IF languages on the three primary desktop platforms.

The most important omission under this plan would be the existing set of multimedia TADS 2 and TADS 3 games. However, I am somewhat optimistic that the same implementation bits needed to make WebKit work will also make possible a full HTML TADS port.

So the next step is to investigate WebKit and see what it will take to get it running atop Gargoyle’s OS layer. Ideally I’d augment the collection of OS functions in a way that also supports an HTML TADS implementation. I have to be careful to avoid bloat, though – the OS code serves as a porter’s TODO list, and complicating it unnecessarily is a good way to ensure that Gargoyle won’t be widely ported.

This entry was posted in Gargoyle. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>