The algorithm used to apply abbreviations for Z-code has been replaced with a more efficient dynamic programming algorithm, based on the paper by R.A. Wagner “Common phrases and minimum-space text storage”, Communications of the ACM, 16 (3) (1973).
Inform has been refactored to use dynamic memory allocation rather than fixed size buffers. As a result, the following settings are now removed: if the available space is filled, Inform will allocate more memory without requiring user intervention.
ALLOC_CHUNK_SIZE
SYMBOLS_CHUNK_SIZE
MAX_ABBREVS (removed only for Glulx)
MAX_ACTIONS
MAX_ADJECTIVES
MAX_ARRAYS
MAX_CLASSES
MAX_DICT_ENTRIES
MAX_EXPRESSION_NODES
MAX_GLOBAL_VARIABLES
MAX_INCLUSION_DEPTH
MAX_INDIV_PROP_TABLE_SIZE
MAX_LABELS
MAX_LINESPACE
MAX_LINK_DATA_SIZE
MAX_LOCAL_VARIABLES (now a constant)
MAX_LOW_STRINGS
MAX_NUM_STATIC_STRINGS
MAX_OBJ_PROP_COUNT
MAX_OBJ_PROP_TABLE_SIZE
MAX_OBJECTS
MAX_PROP_TABLE_SIZE
MAX_QTEXT_SIZE
MAX_SOURCE_FILES
MAX_STATIC_DATA
MAX_STATIC_STRINGS
MAX_SYMBOLS
MAX_TRANSCRIPT_SIZE
MAX_UNICODE_CHARS
MAX_VERBS
MAX_VERBSPACE
MAX_ZCODE_SIZE
As a result of this, the memory size command line arguments ($SMALL, $LARGE and $HUGE) are now redundant, and have been removed.
It is now possible to declare an individual property with the Property directive:
Property individual propname;
A new setting $ZCODE_LESS_DICT_DATA has been introduced. When set to a non-zero value, this tells the compiler to omit the last byte of Z-code dictionary entries (which can be referred as #dict_par3), as this is commonly unused.
There are now warnings if the compiler detects that the type used in certain expressions is not correct. This only checks expressions that contain defined symbols, and does not change the generated code. The checks are:
remove O: O is an object
move O to P: O is an object; P is an object or a class
give O A: O is an object; A is an attribute
O has/hasnt A: O is an object; A is an attribute
O in/notin P: O is an object; P is an object or a class
X ofclass C: C is a class
X provides P: P is a property
X.P, X.P(), X.&P, X.#P: P is a property
Assembly output (-a mode) now shows symbolic information for each assembly operand, if possible.
The -u switch now generates $MAX_ABBREVS possible abbreviations.
The Trace verbs directive now prints out the entire grammar table.
Using the -D switch when the game or library does not support debug_flag now produces an explanatory warning:
DEBUG mode is on, but this story or library does not appear to support it
Expressions of the form (x <= y or z) or (x >= y or z) now produce a warning message: while their effect is documented, well defined, and is not being changed, it is not necessarily what a user might expect.
The check for whether an abbreviation actually reduces the size of the Z-code output file has been made more accurate, and the message if an abbreviation does not reduce the size is now a warning, rather than an error.
Bugs fixed
For Glulx, stub functions (and the veneer function Symb__Tab()) are now always compiled as local-argument functions (with a type byte of 0xC1). Previously, they were in some cases compiled as stack-argument functions (with a type byte of 0xC0).
Counts of properties in errors and in the statistics report (output with the -s switch) are now consistent, and reflect how many properties the user can define.
The check that there are not too many common properties defined now correctly excludes individual and alias properties.
Inform will now report an error if the “class” line of a class definition mentions the class being defined.
A crash when compiling a malformed array declaration has been fixed.
Woot, this is fantastic news. Thanks, David, and thanks, Andrew, for the dynamic memory allocation, and @mulehollandaise for the abbreviation implementation.
I’ve been thinking about schemes for optimizing text storage space by identifying common substrings and had been failing to find the right search terms to turn up the prior art I felt sure must exist, so I appreciate the pointer to the paper! Guess I should’ve been following Highly optimized abbreviations computed efficiently.
I6 6.35 and 6.36 should compile exactly the same game files for Z-code, except for the header field that says “Compiled by Inform 6.35/6.36”.
For Glulx, the compiled game files differ slightly (see this bug, fixed in 6.36). But the result should be the same size or, perhaps, slightly shorter.
I know that there was some discussion not so very long ago about the best options to use when compiling, but I can’t seem to find it now. The basic compilation command of
cc *.c -o inform
works fine, but weren’t some switches for optimization recommended?
If there were, these switches do not seem to be mentioned in either the current release notes or the readme.txt file included with source. Would it be possible to add the correct invocation to one or both documents?
cc -DMACOS -O2 -o inform *.c
cc -DLINUX -O2 -o inform *.c
The OS define doesn’t change the compilation speed. The main thing it gets you is high-precision time measurement. When you use the -s option, the compiler will tell you:
Completed in 0.060 seconds
With no OS define, it defaults to measuring seconds, so it will print:
Is that file supposed to be included in the source code download that’s at the IF Archive? At present, the included readme.txt file only says:
This is version 6.36 of the Inform compiler,
copyright (c) Graham Nelson 1993 - 2022
Full release notes and instructions are available at
http://www.ifarchive.org/indexes/if-archiveXinfocomXcompilersXinform6.html
and the release notes at that URL (which could probably be switched to https since it looks like that’s supported now) doesn’t mention the README.md file or its URL.
Hm, yes, I see. I guess that readme.txt was written with the assumption that any important information would be in the release notes (at that Archive URL). But the compilation info isn’t.