Skip to content

Commit a7b7ac5

Browse files
authored
[spec] Describe backwards-compatibility and reserve 0xFF opcode (#1900)
1 parent 4086224 commit a7b7ac5

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

document/core/appendix/changes.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,44 @@ Change History
77
Since the original release 1.0 of the WebAssembly specification, a number of proposals for extensions have been integrated.
88
The following sections provide an overview of what has changed.
99

10+
All present and future versions of WebAssembly are intended to be *backwards-compatible* with all previous versions.
11+
Concretely:
12+
13+
1. All syntactically well-formed (in :ref:`binary <binary>` or :ref:`text <text>` format) and :ref:`valid <valid>` modules remain well-formed and valid with an equivalent :ref:`module type <syntax-moduletype>` (or a subtype).
14+
15+
.. note::
16+
This allows previously malformed or invalid modules to become legal,
17+
e.g., by adding new features or by relaxing typing rules.
18+
19+
It also allows reclassifying previously malformed modules as well-formed but invalid,
20+
or vice versa.
21+
22+
And it allows refining the typing of :ref:`imports <syntax-import>` and :ref:`exports <syntax-export>`,
23+
such that previously unlinkable modules become linkable.
24+
25+
Historically, minor breaking changes to the *text format* have been allowed
26+
that turned previously possible valid modules invalid,
27+
as long as they were unlikely to occur in practice.
28+
29+
2. All non-:ref:`trapping <trap>` :ref:`executions <exec>` of a valid program retain their behaviour with an equivalent set of possible :ref:`results <syntax-result>` (or a non-empty subset).
30+
31+
.. note::
32+
This allows previously malformed or invalid programs to become executable.
33+
34+
It also allows program executions that previously trapped to execute successfully,
35+
although the intention is to only exercise this where the possibility of such an extension has been previously noted.
36+
37+
And it allows reducing the set of observable behaviours of a program execution,
38+
e.g., by reducing non-determinism.
39+
40+
In a program linking prior modules with modules using new features,
41+
a prior module may encounter new behaviours,
42+
e.g., new forms of control flow or side effects when calling into a latter module.
43+
44+
In addition, future versions of WebAssembly will not allocate the :ref:`opcode <binary-instr>` :math:`\hex{FF}` to represent an instruction or instruction prefix.
45+
46+
47+
1048
Release 2.0
1149
~~~~~~~~~~~
1250

document/core/valid/modules.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,7 @@ Imports :math:`\import` and import descriptions :math:`\importdesc` are classifi
729729
pair: validation; module
730730
single: abstract syntax; module
731731
.. _valid-module:
732+
.. _syntax-moduletype:
732733

733734
Modules
734735
~~~~~~~

0 commit comments

Comments
 (0)