Skip to content

Commit 57d4e22

Browse files
committed
Tagging future features with icon.
Added brief item on multiple return.
1 parent cad0ea9 commit 57d4e22

15 files changed

+74
-61
lines changed

BinaryEncoding.md

+20-12
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ The binary encoding is a dense representation of module information that enables
66
small files, fast decoding, and reduced memory usage.
77
See the [rationale document](Rationale.md#why-a-binary-encoding) for more detail.
88

9+
[:unicorn:](PostMVP.md) = Planned [future](PostMVP.md) feature
10+
911
The encoding is split into three layers:
1012

1113
* **Layer 0** is a simple binary encoding of the bytecode instructions and related data structures.
1214
The encoding is dense and trivial to interact with, making it suitable for
1315
scenarios like JIT, instrumentation tools, and debugging.
14-
* **Layer 1** provides structural compression on top of layer 0, exploiting
16+
* **Layer 1** [:unicorn:](PostMVP.md) provides structural compression on top of layer 0, exploiting
1517
specific knowledge about the nature of the syntax tree and its nodes.
1618
The structural compression introduces more efficient encoding of values,
1719
rearranges values within the module, and prunes structurally identical
1820
tree nodes.
19-
* **Layer 2** Layer 2 applies generic compression algorithms, like [gzip](http://www.gzip.org/) and [Brotli](https://datatracker.ietf.org/doc/draft-alakuijala-brotli/), that are already available in browsers and other tooling.
21+
* **Layer 2** [:unicorn:](PostMVP.md) Layer 2 applies generic compression algorithms, like [gzip](http://www.gzip.org/) and [Brotli](https://datatracker.ietf.org/doc/draft-alakuijala-brotli/), that are already available in browsers and other tooling.
2022

2123
Most importantly, the layering approach allows development and standardization to
2224
occur incrementally. For example, Layer 1 and Layer 2 encoding techniques can be
@@ -25,7 +27,7 @@ compression techniques stabilize, they can be standardized and moved into nativ
2527
implementations.
2628

2729
See
28-
[proposed layer 1 compression](https://github.com/WebAssembly/decompressor-prototype/blob/master/CompressionLayer1.md)
30+
[proposed layer 1 compression :unicorn:](https://github.com/WebAssembly/decompressor-prototype/blob/master/CompressionLayer1.md)
2931
for a proposal for layer 1 structural compression.
3032

3133

@@ -67,7 +69,7 @@ All types are distinguished by a negative `varint7` values that is the first byt
6769

6870
Some of these will be followed by additional fields, see below.
6971

70-
Note: Gaps are reserved for future extensions. The use of a signed scheme is so that types can coexist in a single space with (positive) indices into the type section, which may be relevant for future extensions of the type system.
72+
Note: Gaps are reserved for [future :unicorn:](PostMVP.md) extensions. The use of a signed scheme is so that types can coexist in a single space with (positive) indices into the type section, which may be relevant for future extensions of the type system.
7173

7274
### `value_type`
7375
A `varint7` indicating a [value type](Semantics.md#types). One of:
@@ -92,7 +94,7 @@ In the MVP, only one type is available:
9294

9395
* [`anyfunc`](AstSemantics.md#table)
9496

95-
Note: In the future, other element types may be allowed.
97+
Note: In the [future :unicorn:](PostMVP.md), other element types may be allowed.
9698

9799
### `func_type`
98100
The description of a function signature. Its type constructor is followed by an additional description:
@@ -105,7 +107,7 @@ The description of a function signature. Its type constructor is followed by an
105107
| return_count | `varuint1` | the number of results from the function |
106108
| return_type | `value_type?` | the result type of the function (if return_count is 1) |
107109

108-
Note: In the future, `return_count` and `return_type` might be generalised to allow multiple values.
110+
Note: In the [future :unicorn:](PostMVP.md#multiple-return), `return_count` and `return_type` might be generalised to allow multiple values.
109111

110112
## Other Types
111113

@@ -150,7 +152,7 @@ A packed tuple that describes the limits of a
150152
| initial | `varuint32` | initial length (in units of table elements or wasm pages) |
151153
| maximum | `varuint32`? | only present if specified by `flags` |
152154

153-
Note: In the future, the "flags" field may be extended, e.g., to include a flag for sharing between threads.
155+
Note: In the [future :unicorn:](PostMVP.md#threads), the "flags" field may be extended, e.g., to include a flag for sharing between threads.
154156

155157
### `init_expr`
156158
The encoding of an [initializer expression](Modules.md#initializer-expression)
@@ -221,7 +223,8 @@ The type section declares all function signatures that will be used in the modul
221223
| count | `varuint32` | count of type entries to follow |
222224
| entries | `func_type*` | repeated type entries as described below |
223225

224-
Note: In the future, this section may contain other forms of type entries as well, which can be distinguished by the `form` field of the type encoding.
226+
Note: In the [future :unicorn:](FutureFeatures.md#more-table-operators-and-types),
227+
this section may contain other forms of type entries as well, which can be distinguished by the `form` field of the type encoding.
225228

226229
### Import section
227230

@@ -503,7 +506,8 @@ The `br_table` operator implements an indirect branch. It accepts an optional va
503506
branches to the block or loop at the given offset within the `target_table`. If the input value is
504507
out of range, `br_table` branches to the default target.
505508

506-
Note: Gaps in the opcode space, here and elsewhere, are reserved for future extensions.
509+
Note: Gaps in the opcode space, here and elsewhere, are reserved for
510+
[future :unicorn:](PostMVP.md) extensions.
507511

508512
## Call operators ([described here](Semantics.md#calls))
509513

@@ -512,7 +516,9 @@ Note: Gaps in the opcode space, here and elsewhere, are reserved for future exte
512516
| `call` | `0x10` | function_index : `varuint32` | call a function by its [index](Modules.md#function-index-space) |
513517
| `call_indirect` | `0x11` | type_index : `varuint32`, reserved : `varuint1` | call a function indirect with an expected signature |
514518

515-
The `call_indirect` operator takes a list of function arguments and as the last operand the index into the table. Its `reserved` immediate is for future use and must be `0` in the MVP.
519+
The `call_indirect` operator takes a list of function arguments and as the last
520+
operand the index into the table. Its `reserved` immediate is for
521+
[future :unicorn:](FutureFeatures.md#multiple-tables-and-memories) use and must be `0` in the MVP.
516522

517523
## Parametric operators ([described here](Semantics.md#type-parametric-operators))
518524

@@ -571,10 +577,12 @@ The `memory_immediate` type is encoded as follows:
571577
As implied by the `log2(alignment)` encoding, the alignment must be a power of 2.
572578
As an additional validation criteria, the alignment must be less or equal to
573579
natural alignment. The bits after the
574-
`log(memory-access-size)` least-significant bits must be set to 0. These bits are reserved for future use
580+
`log(memory-access-size)` least-significant bits must be set to 0. These bits
581+
are reserved for [future :unicorn:](PostMVP.md#threads) use
575582
(e.g., for shared memory ordering requirements).
576583

577-
The `reserved` immediate to the `current_memory` and `grow_memory` operators is for future use and must be 0 in the MVP.
584+
The `reserved` immediate to the `current_memory` and `grow_memory` operators is
585+
for [future :unicorn:](FutureFeatures.md#multiple-tables-and-memories) use and must be 0 in the MVP.
578586

579587
## Constants ([described here](Semantics.md#constants))
580588

CAndC++.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ has an LP64 data model, meaning that `long` and pointer types will be
2020

2121
[The MVP](MVP.md) will support only wasm32; support for wasm64 will be
2222
added in the future to support
23-
[64-bit address spaces](FutureFeatures.md#linear-memory-bigger-than-4-gib).
23+
[64-bit address spaces :unicorn:](FutureFeatures.md#linear-memory-bigger-than-4-gib).
2424

2525
`float` and `double` are the IEEE 754-2008 single- and double-precision types,
2626
which are native in WebAssembly. `long double` is the IEEE 754-2008

DynamicLinking.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ To implement run-time dynamic linking (e.g., `dlopen` and `dlsym`):
6969
search the instances's exports, append the found function to the function
7070
table (using host-defined functionality in the MVP, but directly from
7171
WebAssembly code in the
72-
[future](FutureFeatures.md#more-table-operators-and-types)) and return the
72+
[future :unicorn:](FutureFeatures.md#more-table-operators-and-types)) and return the
7373
table index of the appended element to the caller.
7474

7575
Note that the representation of a C function-pointer in WebAssembly is an index

FAQ.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ There are two main benefits WebAssembly provides:
2424
2. By avoiding the simultaneous asm.js constraints of [AOT][]-[compilability][]
2525
and good performance even on engines without
2626
[specific asm.js optimizations][], a new standard makes it *much easier* to
27-
add the [features](FutureFeatures.md) required to reach native levels of
27+
add the [features :unicorn:](FutureFeatures.md) required to reach native levels of
2828
performance.
2929

3030
[experiments]: BinaryEncoding.md#why-a-binary-encoding-instead-of-a-text-only-representation
@@ -95,7 +95,7 @@ reusing a modular C++ library can be as simple as [using a module from JavaScrip
9595

9696
Beyond the MVP, another [high-level goal](HighLevelGoals.md)
9797
is to improve support for languages other than C/C++. This includes [allowing WebAssembly code to
98-
allocate and access garbage-collected (JavaScript, DOM, Web API) objects](FutureFeatures.md#gcdom-integration).
98+
allocate and access garbage-collected (JavaScript, DOM, Web API) objects :unicorn:](FutureFeatures.md#gcdom-integration).
9999
Even before GC support is added to WebAssembly, it is possible to compile a language's VM
100100
to WebAssembly (assuming it's written in portable C/C++) and this has already been demonstrated
101101
([1](http://ruby.dj), [2](https://kripken.github.io/lua.vm.js/lua.vm.js.html),
@@ -177,7 +177,7 @@ together in a number of configurations:
177177
today) allowing developers to reuse popular WebAssembly libraries just like
178178
JavaScript libraries today.
179179
* When WebAssembly
180-
[gains the ability to access garbage-collected objects](FutureFeatures.md#gcdom-integration),
180+
[gains the ability to access garbage-collected objects :unicorn:](FutureFeatures.md#gcdom-integration),
181181
those objects will be shared with JavaScript, and not live in a walled-off
182182
world of their own.
183183

@@ -283,7 +283,7 @@ it, but fast-math flags are not believed to be important enough:
283283
would be feature tests allowing WebAssembly code to determine which SIMD
284284
types to use on a given platform.
285285
* When WebAssembly
286-
[adds an FMA operator](FutureFeatures.md#additional-floating-point-operators),
286+
[adds an FMA operator :unicorn:](FutureFeatures.md#additional-floating-point-operators),
287287
folding multiply and add sequences into FMA operators will be possible.
288288
* WebAssembly doesn't include its own math functions like `sin`, `cos`, `exp`,
289289
`pow`, and so on. WebAssembly's strategy for such functions is to allow them
@@ -312,7 +312,7 @@ operators:
312312
* the MVP starts with the ability to grow linear memory via a
313313
[`grow_memory`](Semantics.md#resizing) operator;
314314
* proposed
315-
[future features](FutureFeatures.md#finer-grained-control-over-memory) would
315+
[future features :unicorn:](FutureFeatures.md#finer-grained-control-over-memory) would
316316
allow the application to change the protection and mappings for pages in the
317317
contiguous range `0` to `memory_size`.
318318

FeatureTest.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ See [rationale](Rationale.md#feature-testing---motivating-scenarios) for motivat
22

33
# Feature Test
44

5-
[PostMVP](PostMVP.md), applications will be able to query which features are
6-
supported via [`has_feature` or a similar API](PostMVP.md#feature-testing). This
5+
[PostMVP :unicorn:](PostMVP.md), applications will be able to query which features are
6+
supported via [`has_feature` or a similar API :unicorn:](PostMVP.md#feature-testing). This
77
accounts for the pragmatic reality that features are shipped in different orders
88
at different times by different engines.
99

@@ -40,15 +40,15 @@ it can be constant-folded by WebAssembly engines.
4040

4141
To illustrate, consider 4 examples:
4242

43-
* [`i32.min_s`](FutureFeatures.md#additional-integer-operators) - Strategy 2
43+
* [`i32.min_s` :unicorn:](FutureFeatures.md#additional-integer-operators) - Strategy 2
4444
could be used to translate `(i32.min_s lhs rhs)` into an equivalent expression
4545
that stores `lhs` and `rhs` in locals then uses `i32.lt_s` and `select`.
46-
* [Threads](PostMVP.md#threads) - If an application uses `#ifdef` extensively
46+
* [Threads :unicorn:](PostMVP.md#threads) - If an application uses `#ifdef` extensively
4747
to produce thread-enabled/disabled builds, Strategy 1 would be appropriate.
4848
However, if the application was able to abstract use of threading to a few
4949
primitives, Strategy 2 could be used to patch in the right primitive
5050
implementation.
51-
* [`mprotect`](FutureFeatures.md#finer-grained-control-over-memory) - If engines
51+
* [`mprotect` :unicorn:](FutureFeatures.md#finer-grained-control-over-memory) - If engines
5252
aren't able to use OS signal handling to implement `mprotect` efficiently,
5353
`mprotect` may become a permanently optional feature. For uses of `mprotect`
5454
that are not necessary for correctness (but rather just catching bugs),
@@ -96,5 +96,5 @@ polyfill would then replace `foo` with `foo_f64x2` if
9696
coarser granularity substitution. Since this is all in userspace, the strategy
9797
can evolve over time.
9898

99-
See also the [better feature testing support](FutureFeatures.md#better-feature-testing-support)
99+
See also the [better feature testing support :unicorn:](FutureFeatures.md#better-feature-testing-support)
100100
future feature.

FutureFeatures.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
These are features that make sense in the context of the
44
[high-level goals](HighLevelGoals.md) of WebAssembly but are not considered part
5-
of the [Minimum Viable Product](MVP.md) or the essential [post-MVP](PostMVP.md)
5+
of the [Minimum Viable Product](MVP.md) or the essential
6+
[post-MVP :unicorn:](PostMVP.md)
67
feature set which are expected to be standardized immediately after the
78
MVP. These will be prioritized based on developer feedback, and will be
89
available under [feature tests](FeatureTest.md).
@@ -420,6 +421,11 @@ of WebAssembly in browsers:
420421
custom compression (on top of the spec-defined binary format, under generic
421422
HTTP `Content-Encoding` compression).
422423

424+
## Multiple Return
425+
426+
The stack based nature of WebAssembly lends itself to the possibility
427+
of supporting multiple return values from blocks / functions.
428+
423429
## Multiple Tables and Memories
424430

425431
The MVP limits modules to at most one memory and at most one table (the default

GC.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# GC / DOM / Web API Integration
1+
# GC / DOM / Web API Integration :unicorn:
2+
3+
## NOTE: This is a [future :unicorn:](PostMVP.md) feature! ##
24

35
After the [MVP](MVP.md), to realize the [high-level goals](HighLevelGoals.md)
46
of (1) integrating well with the existing Web platform and (2) supporting

HighLevelGoals.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
aimed at [C/C++](CAndC++.md);
1313
* a [follow-up to the MVP](PostMVP.md) which adds several more
1414
essential features; and
15-
* [additional features](FutureFeatures.md), specified iteratively and
15+
* [additional features :unicorn:](FutureFeatures.md), specified iteratively and
1616
prioritized by feedback and experience, including support for languages
1717
other than C/C++.
1818
3. Design to execute within and integrate well with the *existing*

JS.md

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
# JavaScript API
22

33
In the [MVP](MVP.md), the only way to access WebAssembly on the Web is through
4-
an explicit JS API which is defined below. (In the future, WebAssembly may also
4+
an explicit JS API which is defined below.
5+
(In the [future :unicorn:](PostMVP.md), WebAssembly may also
56
be loaded and run directly from an HTML `<script type='module'>` tag—and
67
any other Web API that loads ES6 modules via URL—as part of
78
[ES6 Module integration](Modules.md#integration-with-es6-modules).)
89

9-
*Note: current experimental WebAssembly implementations expose a single
10-
all-in-one function `Wasm.instantiateModule(bytes, imports)` which is used
11-
by the current [demo](http://webassembly.github.io/demo). This function is
12-
basically equivalent to
13-
`new WebAssembly.Instance(new WebAssembly.Module(bytes), imports)`
14-
as defined below and will be removed at some point in the future.*
15-
1610
## Traps
1711

1812
Whenever WebAssembly semantics specify a [trap](Semantics.md#traps),
@@ -90,7 +84,7 @@ The asynchronous compilation is logically performed on a copy of the state of
9084
the given `BufferSource` captured during the call to `compile`; subsequent mutations
9185
of the `BufferSource` after `compile` return do not affect ongoing compilations.
9286

93-
In the [future](FutureFeatures.md#streaming-compilation), this function can be
87+
In the [future :unicorn:](FutureFeatures.md#streaming-compilation), this function can be
9488
extended to accept a [stream](https://streams.spec.whatwg.org), thereby enabling
9589
asynchronous, background, streaming compilation.
9690

@@ -481,7 +475,7 @@ Let `element` be the result of calling [`Get`](http://tc39.github.io/ecma262/#se
481475
If `element` is not the string `"anyfunc"`, a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror)
482476
is thrown.
483477
(Note: this check is intended to be relaxed in the
484-
[future](FutureFeatures.md#more-table-operators-and-types) to allow different
478+
[future :unicorn:](FutureFeatures.md#more-table-operators-and-types) to allow different
485479
element types.)
486480

487481
Let `initial` be [`ToNonWrappingUint32`](#tononwrappinguint32)([`Get`](http://tc39.github.io/ecma262/#sec-get-o-p)(`tableDescriptor`, `"initial"`)).

MVP.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
As stated in the [high-level goals](HighLevelGoals.md), the first release aims
44
at being a Minimum Viable Product (MVP). This means that there are important
55
features we *know* we want and need, but are post-MVP; these are in a separate
6-
essential [post-MVP](PostMVP.md) features document. The MVP will contain
6+
essential [post-MVP :unicorn:](PostMVP.md) features document. The MVP will contain
77
features which are available today in modern web browsers and which perform well
88
even on mobile devices, which leads to roughly the same functionality as
99
[asm.js](http://asmjs.org).

0 commit comments

Comments
 (0)