I am currently writing a new z-machine implementation in Rust that I will release publicly when it is a little further along. Not an interpreter, but rather a reusable library that encapsulates as much z-machine behavior as possible. This isn’t my first z-machine implementation. I tend to write one whenever I learn a new language as I find it is a good way to become familiar with a language’s features and idioms. I do like the idea of a 1.2 standard to both extend and clarify the z-machine.
My opinions on the draft are below (I haven’t read all of it in depth, so more opinions may follow later):
Non-BMP unicode - I don’t have an issue with this, although I haven’t looked at it in detail. It may be more difficult for non-utf16 based interpreters to implement (non-Windows OS’s tend to use utf-8, so that’s something to keep in mind).
Sound - Are more channels really needed? Also, I dislike the current effect/music split and multiplying that again by channels seems really ugly. This seems more suited to a hypothetical V9 that could unify the two approaches to playing more sound.
Gestalt opcode - This doesn’t fit the z-machine at all. A header extension table for just the new features would be more z-machine-like. Also, providing a duplicate way to check features for which header flags already exist is redundant and I strongly dislike redundancy - what do you do if they don’t agree through interpreter bug, or otherwise? An example of what this leads to is the transcript bit in the header, plus the output_stream opcode. No thanks.
Interrupt queuing: While this makes sense, my past interpreters never behaved this way, so you may generate games incompatible with existing interpreters. A queue implies memory allocation, so a maximum value should be enforced, with provisions as to what happens when it is exceeded (a missing timeout interrupt could be game-breaking.)
Other features: haven’t read all the details yet, although standardizing print_table seems worthwhile.
Additional comments:
While an update to the standard to add new features is great. I think it would also be useful to more deeply examine some currently undefined behavior as well. I’ve compiled a list of some while working on my interpreters over the years. If anyone thinks a separate thread listing and discussing z-machine UB is worthwhile, I can post what I have.
Also, I think conversation regarding a V9 is worthwhile. For example from the remarks on section 12 (the object table) of the standard: “Bit 6 in the second byte is presently wasted, which is a pity as it could be used to allow up to 128 bytes of property data. But such a change would cause Infocom’s story files to fail (since they set this bit, unlike Inform story files).” This is the perfect candidate for a V9 feature, vs. purely a standard extension.