1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-05 00:24:22 +03:00
inform7/inform6/Inform6/ReleaseNotes.html
2022-07-24 11:10:45 +01:00

187 lines
11 KiB
HTML
Executable file

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Inform Release Notes</title>
</head>
<body>
<h1>Inform 6.4 Release Notes</h1>
<h2>Introduction</h2>
This is a maintenance release of the Inform 6 compiler for creating interactive fiction. Although just about
all known bugs are fixed, the approach to enhancing Inform is more conservative. The selection of suggestions
to implement has been governed by two factors:
<ul>
<li><p>Avoidance of changes which might cause existing games to misbehave; and
<li><p>Minimisation of features which would require updates to the <i>Inform Designer&rsquo;s Manual</i>.
</ul>
Since the first release of the Inform 6.3 compiler, the Inform 6 library has been split into a separate project,
maintained at <a href="https://gitlab.com/DavidGriffith/inform6lib">https://gitlab.com/DavidGriffith/inform6lib</a>.
<h2>Acknowledgements</h2>
Far too many people contributed towards this release &mdash; reporting and resolving bugs, making helpful
suggestions, providing support and facilities, testing, and so on &mdash; for their names to be individually
listed. So instead, this is a general thank-you to everybody who has made this release happen, and
specific ones to Graham Nelson for permitting it in the first place, and to Andrew Plotkin, who is responsible
for most of the actual changes to the compiler code.
<h2>Inform 6.41</h2>
These are the changes delivered in version 6.41 of the Inform compiler.
<h3>Features added</h3>
<ul>
<li><p>The dead code elimination logic now allows forward jumps to labels that would be otherwise unreachable, like this:
<pre>
if (condition) {
jump MiddleLabel;
}
if (0) {
while (condition) {
...
.MiddleLabel;
...
}
}
</pre>
<li><p>The error that occurs when the compiler encounters a jump to an unknown label now includes the name of that label.
</ul>
<h2>Inform 6.40</h2>
These are the changes delivered in version 6.40 of the Inform compiler.
<h3>Features added</h3>
<ul>
<li><p>The various command line arguments that produce tracing or statistical information have been consolidated in a new
argument: <tt>$!TRACEOPT</tt> or <tt>$!TRACEOPT=N</tt>. The Unix-style equivalent is <tt>--trace TRACEOPT</tt> or
<tt>--trace TRACEOPT=N</tt>. You can also use <tt>$!</tt> by itself (or <tt>--helptrace</tt>) to list all available trace options.
Trace option names are case-insensitive.
<p>
The optional <tt>N</tt> is always an integer. 0 always means off, 1 is the base level, 2 or more may increase verbosity.
As a general rule, setting <tt>N</tt> to a high number is not an error; it just does the same thing as the highest supported
number for that option. (This lets us add more verbosity levels to any option without worrying about compatibility errors.)
<p>
Four trace settings can be changed in mid-compile with the <tt>Trace</tt> directive. (This has always been true but now it is handled
consistently.) <tt>Trace assembly</tt>, <tt>Trace expressions</tt>, <tt>Trace tokens</tt> and <tt>Trace linker</tt> are
equivalent to <tt>--trace asm</tt>, <tt>--trace expr</tt>, <tt>--trace tokens</tt> and <tt>--trace linker</tt>, respectively.
As with the command-line versions, you can optionally specify 0 to turn off that setting or 2 or more for more verbosity.
<p>
Four more trace directives do an immediate information dump: <tt>Trace dictionary</tt>, <tt>Trace objects</tt>,
<tt>Trace symbols</tt> and <tt>Trace verbs</tt>. The command-line equivalents <tt>--trace dict</tt>, <tt>--trace objects</tt>,
<tt>--trace symbols</tt> and <tt>--trace verbs</tt> do the same at the end of compilation.
<p>
The following single-letter options have been removed and replaced with trace options:
<ul>
<li><tt>-j</tt>: Replaced by <tt>--trace OBJECTS</tt>
<li><tt>-m</tt>: Replaced by <tt>--trace MEM</tt>
<li><tt>-n</tt>: Replaced by <tt>--trace PROPS</tt> (for property information) and <tt>--trace ACTIONS</tt> (for action numbers)
<li><tt>-p</tt>: Replaced by <tt>--trace MAP=2</tt>
<li><tt>-t</tt>: Replaced by <tt>--trace ASM=2</tt>
<li><tt>-y</tt>: Replaced by <tt>--trace LINKER</tt>
</ul><br>
The following single-letter options still exist, but are now aliases for trace options:
<ul><br>
<li><tt>-a</tt>: Same as <tt>--trace ASM</tt>
<li><tt>-f</tt>: Same as <tt>--trace FREQ</tt>
<li><tt>-g</tt>: Same as <tt>--trace RUNTIME</tt>
<li><tt>-s</tt>: Same as <tt>--trace STATS</tt>
<li><tt>-z</tt>: Same as <tt>--trace MAP</tt>
</ul><br>
The following single-letter options have been removed entirely:
<ul><br>
<li><tt>-b</tt>: Has not done anything since at least Inform 5.
<li><tt>-l</tt>: Was supposed to list all statements compiled, but it was never implemented.
<li><tt>-o</tt>: Showed the same information as <tt>-z</tt> or <tt>--trace MAP</tt>.
</ul><br>
The <tt>-l</tt> option did show include files being opened; this is now a separate trace setting, <tt>--trace FILES</tt>.
<p>
Some of the information that used to be under <tt>-a4</tt> is now a separate trace setting, <tt>--trace BPATCH</tt>.
<li><p>The <tt>-u</tt> option now just outputs computed abbreviations. If you want the verbose calculation information that
it used to print, use <tt>--trace FINDABBREVS</tt> or <tt>--trace FINDABBREVS=2</tt>.
<li><p>The compiler is now capable of dead code elimination, allowing it to:
<ul>
<li>Discard unreachable opcodes and strings.
<li>Minimize generated code for dead branches (<tt>if (0)</tt>, <tt>if (1)</tt>).
<li>Detect <tt>if</tt> and <tt>switch</tt> statements where every branch returns.
<li>Detect loops that never exit (or always return).
<li>Discard <tt>@jz constant</tt> opcodes where the constant is non-zero.
<li>Convert <tt>@jz 0</tt> to an unconditional <tt>@jump</tt>.
<li>Discard a <tt>@jump</tt> to the very next instruction.
<li>Discard store opcodes when computing a logical expression as a value, if one case (0 or 1) is impossible.
<li>Fold expressions like <tt>(0 && expr)</tt> and <tt>(1 || expr)</tt>, even when <tt>expr</tt> is not a constant.
</ul><br>
When statements that can never be reached are eliminated, a warning is produced, where appropriate.
<p>
Dead code elimination does mean that theoretically possible (though very odd) valid code will now
result in a compilation error. For example,
<pre>
if (DOSTUFF) {
while (condition) {
...
.MiddleLabel;
...
}
}
jump MiddleLabel; ! error
</pre>
This will fail with a compilation error if <tt>DOSTUFF</tt> is defined as a constant zero. This optimization
can be turned off by setting the compiler setting <tt>$STRIP_UNREACHABLE_LABELS</tt> to zero (its default is one).
<li><p>There are now further warnings if the compiler detects that the type used in certain expressions is not correct:
<ul>
<li><tt>X()</tt>, <tt>indirect(X)</tt>: X must be a routine
<li><tt>X.Y</tt>, <tt>X.&Y</tt>, <tt>X.#Y</tt>: X must be a class or an object; Y must be a property (the Y checks already existed)
<li><tt>X.Y()</tt>: X must be a class, object, string or routine; Y must be a property
<li><tt>X.Y++</tt>, <tt>X.Y--</tt>, <tt>++X.Y</tt>, <tt>--X.Y</tt>: X must be a class or an object; Y must be a property
</ul>
<li><p>There is a new syntax for dynamic-string interpolations: <tt>"@(N)"</tt>. The original syntax was <tt>"@NN"</tt>,
which is still supported. In the new syntax <tt>"N"</tt> can be a number, or an already defined numeric constant.
As a result of this, under Glulx the limit on <tt>$MAX_DYNAMIC_STRINGS</tt> being less than 100 has been removed.
<li><p>The constants <tt>#dictionary_table</tt> and <tt>#grammar_table</tt> are now available when compiling to
Z-code, as well as Glulx.
<li><p>The command line switch to display percentages (<tt>-p</tt>) now works with Glulx, and acts as an
extension to the <tt>-z</tt> switch.
<li><p>The double precision floating point related opcodes added to the Glulx 3.1.3 specification (that is,
<tt>@numtod</tt>, <tt>@dtonumz</tt>, <tt>@dtonumn</tt>, <tt>@ftod</tt>, <tt>@dtof</tt>, <tt>@dceil</tt>, <tt>@dfloor</tt>,
<tt>@dadd</tt>, <tt>@dsub</tt>, <tt>@dmul</tt>, <tt>@ddiv</tt>, <tt>@dmodr</tt>, <tt>@dmodq</tt>, <tt>@dsqrt</tt>,
<tt>@dexp</tt>, <tt>@dlog</tt>, <tt>@dpow</tt>, <tt>@dsin</tt>, <tt>@dcos</tt>, <tt>@dtan</tt>, <tt>@dasin</tt>,
<tt>@dacos</tt>, <tt>@datan</tt>, <tt>@datan2</tt>, <tt>@jdeq</tt>, <tt>@jdne</tt>, <tt>@jdlt</tt>, <tt>@jdle</tt>,
<tt>@jdgt</tt>, <tt>@jdge</tt>, <tt>@jdisnan</tt>, <tt>@jdisinf</tt>) are now supported. In addition there are also
two new macros <tt>@dload</tt> and <tt>@dstore</tt>, to load and store double precision floating point values.
<li><p>The undo related opcodes added to the Glulx 3.1.3 specification (that is, <tt>@hasundo</tt> and <tt>@discardundo</tt>)
are now supported.
<li><p>The <tt>Version</tt> and <tt>Switches</tt> directives are now deprecated, and produce a warning if used. The recommended way to
set the Z-code version and any other switches is to use the command line, or <tt>!%</tt> comments at the top of the source file.
<li><p>The ability to compile Inform source code as modules, and then later link it, has been removed. This functionality always had
significant restrictions and was never widely used. The <tt>-M</tt> and <tt>-U</tt> command line options have been removed, along with
the <tt>+module_path</tt> option. The <tt>Link</tt> and <tt>Import</tt> directives now just produce errors.
<li><p>The ability to use temporary files for internal storage (the <tt>-F</tt> switch and the <tt>+temporary_path</tt> option)
have been removed.
<li><p>The <tt>=</tt> sign in the <tt>Global</tt> directive is now optional, just as it is in the <tt>Constant</tt> directive. So all
of these are now legal:
<pre>
Constant c1 11;
Constant c2 = 22;
Global g1 33;
Global g2 = 44;
</pre>
<li><p>The long deprecated forms of the <tt>Global</tt> directive that could define arrays have been removed. All these are now no
longer legal:
<pre>
Global array --> size;
Global array data ...;
Global array initial ...;
Global array initstr ...;
</pre>
</ul>
<h3>Bugs fixed</h3>
<ul>
<li><p><tt>Abbreviation</tt> directives now only add abbreviations to the output file if economy mode (<tt>-e</tt>) is set.
<li><p>An array overrun when the <tt>$ZCODE_LESS_DICT_DATA</tt> setting is enabled has been fixed.
<li><p>The logic that allows a test for the compiler version of the form <tt>#IfDef VN_1640</tt> now requires what follows
the "VN_" to be a number.
</ul>
</body>
</html>