<pclass="purpose">The semantic version number for the current definition of Inter bytecode.</p>
<pclass="commentary firstcommentary"><aid="SP1"class="paragraph-anchor"></a><b>§1. </b>We can expect the details of the Inter language to change. Such changes
could easily render text or binary files of Inter code useless; so we will
want to use semantic versioning to compare the language as we understand it
(the "current version") with the language as it was understood by whoever
wrote the Inter file we are loading (the "file version").
</p>
<pclass="commentary">If we consider the version as having the traditional form <spanclass="extract"><spanclass="extract-syntax">major.minor.patch</span></span>,
the <spanclass="extract"><spanclass="extract-syntax">major</span></span> version should change on any of the following:
</p>
<ulclass="items"><li>(a) Removal of an Inter construct, or any renumbering of <spanclass="extract"><spanclass="extract-syntax">*_IST</span></span> constants.
</li><li>(b) Change of bytecode representation of an instruction.
</li><li>(c) Change of the binary file format in <ahref="3-iibf.html"class="internal">Inter in Binary Files</a>. Note that
</li><li>(d) Change of the textual file format in <ahref="3-iitf.html"class="internal">Inter in Text Files</a> and elsewhere
in the <spanclass="extract"><spanclass="extract-syntax">CONSTRUCT_READ_MTID</span></span> methods for the constructs.
</li><li>(e) Removal of one of the standard annotations, or any renumbering of existing
ones. See <ahref="2-ann.html"class="internal">Annotations</a>.
</li><li>(f) Removal of one of the standard primitives, or any renumbering of existing
ones. See <ahref="../building-module/1-ip.html"class="internal">Inter Primitives (in building)</a>.
</li></ul>
<pclass="commentary">This may result in ungainly, high <spanclass="extract"><spanclass="extract-syntax">major</span></span> version numbers: so be it. However,
the following need only mean a bump of the <spanclass="extract"><spanclass="extract-syntax">minor</span></span> version —
</p>
<ulclass="items"><li>(a) Addition of a new Inter construct, provided the existing ones are not
renumbered.
</li><li>(b) Addition of a new Inter annotation, provided the existing ones are not
renumbered.
</li><li>(c) Addition of a new Inter primitive, provided the existing ones are not
renumbered.
</li></ul>
<pclass="commentary">The <spanclass="extract"><spanclass="extract-syntax">patch</span></span> version number should always remain 0 — this is not a version for
the implementation of anything, just for the specification itself, so in some
<pclass="commentary">Modifiers of the <spanclass="extract"><spanclass="extract-syntax">+</span></span> and <spanclass="extract"><spanclass="extract-syntax">-</span></span> sort are also best avoided here, so we will deal only
<pclass="commentary firstcommentary"><aid="SP2"class="paragraph-anchor"></a><b>§2. </b>1.0.0 (28 April 2022) was the baseline Inter implementation used in the beta of
Inform 10.1.0.
</p>
<pclass="commentary">2.0.0 (24 May 2022) introduced a new base type constructor for "activity on T".
This renumbers the binary representation of types, so it is a major not minor bump.
<pclass="commentary">3.0.0 (9 October 2022) added a new optional field to <spanclass="extract"><spanclass="extract-syntax">SPLAT_IST</span></span> instructions,
which holds I6 annotations in the sense of Inform evolution proposal IE-0006.
Note that these are not Inter annotations, which apply to symbols: these apply
<pclass="commentary">5.0.0 (24 April 2023) added (further) new fields to <spanclass="extract"><spanclass="extract-syntax">SPLAT_IST</span></span> instructions, to
record their provenance and so make better error reporting possible.
<spanclass="identifier-syntax">semantic_version_number</span><spanclass="plain-syntax"></span><spanclass="function-syntax">InterVersion::current</span><buttonclass="popup"onclick="togglePopup('usagePopup1')"><spanclass="comment-syntax">?</span><spanclass="popuptext"id="usagePopup1">Usage of <spanclass="code-font"><spanclass="function-syntax">InterVersion::current</span></span>:<br/><ahref="1-tiv.html#SP4">§4</a><br/>Inter in Binary Files - <ahref="3-iibf.html#SP10_1_1">§10.1.1</a><br/>The Version Construct - <ahref="6-tvc.html#SP2">§2</a></span></button><spanclass="plain-syntax">(</span><spanclass="reserved-syntax">void</span><spanclass="plain-syntax">) {</span>
<spanclass="plain-syntax"></span><spanclass="reserved-syntax">if</span><spanclass="plain-syntax"> (</span><spanclass="identifier-syntax">VersionNumbers::is_null</span><spanclass="plain-syntax">(</span><spanclass="identifier-syntax">V</span><spanclass="plain-syntax">)) </span><spanclass="identifier-syntax">internal_error</span><spanclass="plain-syntax">(</span><spanclass="string-syntax">"malformed version number"</span><spanclass="plain-syntax">);</span>
<spanclass="reserved-syntax">int</span><spanclass="plain-syntax"></span><spanclass="function-syntax">InterVersion::check_readable</span><buttonclass="popup"onclick="togglePopup('usagePopup2')"><spanclass="comment-syntax">?</span><spanclass="popuptext"id="usagePopup2">Usage of <spanclass="code-font"><spanclass="function-syntax">InterVersion::check_readable</span></span>:<br/>Inter in Binary Files - <ahref="3-iibf.html#SP10_1_1">§10.1.1</a><br/>The Version Construct - <ahref="6-tvc.html#SP2">§2</a></span></button><spanclass="plain-syntax">(</span><spanclass="identifier-syntax">semantic_version_number</span><spanclass="plain-syntax"></span><spanclass="identifier-syntax">file_version</span><spanclass="plain-syntax">) {</span>
<pclass="commentary firstcommentary"><aid="SP4"class="paragraph-anchor"></a><b>§4. </b>When Inter is stored in binary format, the version number is stored in three
<spanclass="identifier-syntax">semantic_version_number</span><spanclass="plain-syntax"></span><spanclass="function-syntax">InterVersion::from_three_words</span><buttonclass="popup"onclick="togglePopup('usagePopup4')"><spanclass="comment-syntax">?</span><spanclass="popuptext"id="usagePopup4">Usage of <spanclass="code-font"><spanclass="function-syntax">InterVersion::from_three_words</span></span>:<br/>Inter in Binary Files - <ahref="3-iibf.html#SP2">§2</a>, <ahref="3-iibf.html#SP10_1_1">§10.1.1</a></span></button><spanclass="plain-syntax">(</span><spanclass="reserved-syntax">unsigned</span><spanclass="plain-syntax"></span><spanclass="reserved-syntax">int</span><spanclass="plain-syntax"></span><spanclass="identifier-syntax">w1</span><spanclass="plain-syntax">, </span><spanclass="reserved-syntax">unsigned</span><spanclass="plain-syntax"></span><spanclass="reserved-syntax">int</span><spanclass="plain-syntax"></span><spanclass="identifier-syntax">w2</span><spanclass="plain-syntax">,</span>