Skip to content

Commit 93e4e3b

Browse files
flagxors3ththompson
authored andcommittedOct 28, 2016
Tagging future features with icon. (WebAssembly#839)
Added brief item on multiple return.
1 parent cad0ea9 commit 93e4e3b

15 files changed

+134
-66
lines changed
 

‎BinaryEncoding.md

+27-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:][future general] = 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:][future compression] 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:][future compression] 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:][future compression]
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:][future general] 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:][future general], 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:][future 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:][future 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:][future 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:][future general] 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:][future multiple tables] 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:][future 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:][future multiple tables] use and must be 0 in the MVP.
578586

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

@@ -727,3 +735,10 @@ The `reserved` immediate to the `current_memory` and `grow_memory` operators is
727735
| `i64.reinterpret/f64` | `0xbd` | | |
728736
| `f32.reinterpret/i32` | `0xbe` | | |
729737
| `f64.reinterpret/i64` | `0xbf` | | |
738+
739+
[future general]: PostMVP.md
740+
[future multiple return]: PostMVP.md#multiple-return
741+
[future threads]: PostMVP.md#threads
742+
[future types]: FutureFeatures.md#more-table-operators-and-types
743+
[future multiple tables]: FutureFeatures.md#multiple-tables-and-memories
744+
[future compression]: https://github.com/WebAssembly/decompressor-prototype/blob/master/CompressionLayer1.md

‎CAndC++.md

+4-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:][future 64-bit].
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
@@ -128,3 +128,6 @@ WebAssembly has very limited [nondeterminism](Nondeterminism.md), so it is
128128
expected that compiled WebAssembly programs will behave very consistently
129129
across different implementations, and across different versions of the same
130130
implementation.
131+
132+
[future 64-bit]: FutureFeatures.md#linear-memory-bigger-than-4-gib
133+

‎DynamicLinking.md

+3-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:][future 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
@@ -91,3 +91,5 @@ runtimes will be ABI agnostic, so it will be possible to use a non-standard ABI
9191
for specialized purposes.
9292

9393
[ABI]: https://en.wikipedia.org/wiki/Application_binary_interface
94+
95+
[future types]: FutureFeatures.md#more-table-operators-and-types

‎FAQ.md

+14-8
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ 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
28-
performance.
27+
add the [features :unicorn:][future features] required to reach native
28+
levels of performance.
2929

3030
[experiments]: BinaryEncoding.md#why-a-binary-encoding-instead-of-a-text-only-representation
3131
[streaming]: https://www.w3.org/TR/streams-api/
@@ -93,9 +93,10 @@ However, by [integrating with JavaScript at the ES6 Module interface](Modules.md
9393
web developers don't need to write C++ to take advantage of libraries that others have written;
9494
reusing a modular C++ library can be as simple as [using a module from JavaScript](http://jsmodules.io).
9595

96-
Beyond the MVP, another [high-level goal](HighLevelGoals.md)
97-
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).
96+
Beyond the MVP, another [high-level goal](HighLevelGoals.md)
97+
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
99+
:unicorn:][future dom].
99100
Even before GC support is added to WebAssembly, it is possible to compile a language's VM
100101
to WebAssembly (assuming it's written in portable C/C++) and this has already been demonstrated
101102
([1](http://ruby.dj), [2](https://kripken.github.io/lua.vm.js/lua.vm.js.html),
@@ -177,7 +178,7 @@ together in a number of configurations:
177178
today) allowing developers to reuse popular WebAssembly libraries just like
178179
JavaScript libraries today.
179180
* When WebAssembly
180-
[gains the ability to access garbage-collected objects](FutureFeatures.md#gcdom-integration),
181+
[gains the ability to access garbage-collected objects :unicorn:][future dom],
181182
those objects will be shared with JavaScript, and not live in a walled-off
182183
world of their own.
183184

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

@@ -388,3 +389,8 @@ accessible through regular JavaScript. However, if a wasm VM is provided as an
388389
[“app execution platform”](NonWeb.md) by a specific vendor, it might provide
389390
access to [proprietary platform-specific APIs](Portability.md#api) of e.g.
390391
Android / iOS.
392+
393+
[future features]: FutureFeatures.md
394+
[future dom]: FutureFeatures.md#gcdom-integration
395+
[future floating point]: FutureFeatures.md#additional-floating-point-operators
396+
[future memory control]: FutureFeatures.md#finer-grained-control-over-memory

‎FeatureTest.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ 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:][future general], applications will be able to query which features are
6+
supported via
7+
[`has_feature` or a similar API :unicorn:][future feature testing]. This
78
accounts for the pragmatic reality that features are shipped in different orders
89
at different times by different engines.
910

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

4142
To illustrate, consider 4 examples:
4243

43-
* [`i32.min_s`](FutureFeatures.md#additional-integer-operators) - Strategy 2
44+
* [`i32.min_s` :unicorn:][future integer] - Strategy 2
4445
could be used to translate `(i32.min_s lhs rhs)` into an equivalent expression
4546
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
47+
* [Threads :unicorn:][future threads] - If an application uses `#ifdef` extensively
4748
to produce thread-enabled/disabled builds, Strategy 1 would be appropriate.
4849
However, if the application was able to abstract use of threading to a few
4950
primitives, Strategy 2 could be used to patch in the right primitive
5051
implementation.
51-
* [`mprotect`](FutureFeatures.md#finer-grained-control-over-memory) - If engines
52+
* [`mprotect` :unicorn:][future memory control] - If engines
5253
aren't able to use OS signal handling to implement `mprotect` efficiently,
5354
`mprotect` may become a permanently optional feature. For uses of `mprotect`
5455
that are not necessary for correctness (but rather just catching bugs),
@@ -96,5 +97,11 @@ polyfill would then replace `foo` with `foo_f64x2` if
9697
coarser granularity substitution. Since this is all in userspace, the strategy
9798
can evolve over time.
9899

99-
See also the [better feature testing support](FutureFeatures.md#better-feature-testing-support)
100+
See also the [better feature testing support :unicorn:][future feature testing]
100101
future feature.
102+
103+
[future general]: PostMVP.md
104+
[future feature testing]: PostMVP.md#feature-testing
105+
[future integer]: FutureFeatures.md#additional-integer-operators
106+
[future thread]: PostMVP.md#threads
107+
[future memory control]: FutureFeatures.md#finer-grained-control-over-memory

‎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

+4-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:][future general]
2+
3+
## NOTE: This is a [future :unicorn:][future general] 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
@@ -164,3 +166,4 @@ consider for this feature, but a few points of tentative agreement are:
164166
[Typed Objects](https://github.com/nikomatsakis/typed-objects-explainer/)
165167
proposal.
166168

169+
[future general]: PostMVP.md

‎HighLevelGoals.md

+3-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:][future features], 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*
@@ -33,3 +33,5 @@
3333
clang port ([why LLVM first?](FAQ.md#which-compilers-can-i-use-to-build-webassembly-programs));
3434
* promote other compilers and tools targeting WebAssembly; and
3535
* enable other useful [tooling](Tooling.md).
36+
37+
[future features]: FutureFeatures.md

‎JS.md

+8-11
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:][future general], 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:][future streaming], this function can be
9488
extended to accept a [stream](https://streams.spec.whatwg.org), thereby enabling
9589
asynchronous, background, streaming compilation.
9690

@@ -481,8 +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
485-
element types.)
478+
[future :unicorn:][future types] to allow different element types.)
486479

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

@@ -638,3 +631,7 @@ fetch('demo.wasm').then(response =>
638631

639632
* `WebAssembly.Module` `exports`/`imports` properties (reflection)
640633
* JS API for cyclic imports (perhaps a Promise-returning `WebAssembly.instantiate`?)
634+
635+
[future general]: PostMVP.md
636+
[future streaming]: FutureFeatures.md#streaming-compilation
637+
[future types]: FutureFeatures.md#more-table-operators-and-types

0 commit comments

Comments
 (0)
Please sign in to comment.