<ulclass="crumbs"><li><ahref="../index.html">Home</a></li><li><ahref="../services.html">Services</a></li><li><ahref="index.html">arch</a></li><li><ahref="index.html#P">Preliminaries</a></li><li><b>What This Module Does</b></li></ul></div>
<pclass="commentary firstcommentary"><aid="SP1"class="paragraph-anchor"></a><b>§1. Prerequisites. </b>The arch module is a part of the Inform compiler toolset. It is
full details, but essentially: it's C without predeclarations or header files,
and where functions have names like <spanclass="extract"><spanclass="extract-syntax">Tags::add_by_name</span></span> rather than <spanclass="extract"><spanclass="extract-syntax">add_by_name</span></span>.
<pclass="commentary firstcommentary"><aid="SP2"class="paragraph-anchor"></a><b>§2. Architecture versus VM. </b>The Inform 7 build process works in two stages: first it generates abstract
Inter code, then it further generates "final code" from that.
form of bytecode. Instead, we have "architectures" for Inter: for example,
32-bit with debugging enabled is the <spanclass="extract"><spanclass="extract-syntax">32d</span></span> architecture. See <ahref="2-arc.html"class="internal">Architectures</a>;
if ever we introduce a 64-bit VM, that will need new architectures, and
<pclass="commentary firstcommentary"><aid="SP3"class="paragraph-anchor"></a><b>§3. </b>A <ahref="2-tvm.html#SP2"class="internal">target_vm</a> object, on the other hand, expresses the choices made at
the second stage too. The term "VM" is traditional here, and stands for
"virtual machine", because until 2021, Inform could only generate code which
would ultimately run on virtual machines called Glulx and the Z-machine. But it
<pclass="commentary">As a result, "VM" now has a more general meaning, and really means "form of
final code generation". The Glulx format used to be specified by supplying the
command-line option <spanclass="extract"><spanclass="extract-syntax">-format=ulx</span></span> to <ahref="../inform7/index.html"class="internal">inform7</a> or <ahref="../inter/index.html"class="internal">inter</a>: that still works,
though it is deprecated, and <spanclass="extract"><spanclass="extract-syntax">-format=Inform6/32d</span></span> is better. But equally
possible now would be <spanclass="extract"><spanclass="extract-syntax">-format=C/32d</span></span>. Here the target is a native executable
<pclass="commentary">As these new-style <spanclass="extract"><spanclass="extract-syntax">-format</span></span> options suggest, the compilation process thus
involves a combination of both architecture and target:
<pclass="commentary">Note that a single <ahref="2-tvm.html#SP2"class="internal">target_vm</a> object can be used with just one architecture:
use the function <ahref="2-tvm.html#SP11"class="internal">TargetVMs::get_architecture</a> to obtain this. If a target supports
multiple architectures, then there will be multiple <ahref="2-tvm.html#SP2"class="internal">target_vm</a> objects for it,
one for each architecture it supports. For example, the Glulx VM can be reached
by <spanclass="extract"><spanclass="extract-syntax">Inform6/32</span></span> or <spanclass="extract"><spanclass="extract-syntax">Inform6/32d</span></span>. There can also be multiple versions: for example,
<spanclass="extract"><spanclass="extract-syntax">Inform6/16/v8</span></span> is a valid target. The function <ahref="2-tvm.html#SP6"class="internal">TargetVMs::find</a> finds the
<ahref="2-tvm.html#SP2"class="internal">target_vm</a> object associated with a given textual form like <spanclass="extract"><spanclass="extract-syntax">"C/32d"</span></span>, if
<pclass="commentary firstcommentary"><aid="SP4"class="paragraph-anchor"></a><b>§4. Compatibility. </b>Not all software in the Inform stack — source text from the user, extensions,