Skip to content

Commit cad0ea9

Browse files
s3ththompsonjfbastien
authored andcommitted
fix improperly spaced markdown blocks and typos (for formatting on website (WebAssembly#837)
1 parent 35e5e24 commit cad0ea9

17 files changed

+91
-4
lines changed

BinaryEncoding.md

+7
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,25 @@ Note: Gaps are reserved for future extensions. The use of a signed scheme is so
7171

7272
### `value_type`
7373
A `varint7` indicating a [value type](Semantics.md#types). One of:
74+
7475
* `i32`
7576
* `i64`
7677
* `f32`
7778
* `f64`
79+
7880
as encoded above.
7981

8082
### `block_type`
8183
A `varint7` indicating a block signature. These types are encoded as:
84+
8285
* either a [`value_type`](#value_type) indicating a signature with a single result
8386
* or `-0x40` (i.e., the byte `0x40`) indicating a signature with 0 results.
8487

8588
### `elem_type`
8689

8790
A `varint7` indicating the types of elements in a [table](AstSemantics.md#table).
8891
In the MVP, only one type is available:
92+
8993
* [`anyfunc`](AstSemantics.md#table)
9094

9195
Note: In the future, other element types may be allowed.
@@ -130,6 +134,7 @@ The description of a memory.
130134

131135
### `external_kind`
132136
A single-byte unsigned integer indicating the kind of definition being imported or defined:
137+
133138
* `0` indicating a `Function` [import](Modules.md#imports) or [definition](Modules.md#function-and-code-sections)
134139
* `1` indicating a `Table` [import](Modules.md#imports) or [definition](Modules.md#table-section)
135140
* `2` indicating a `Memory` [import](Modules.md#imports) or [definition](Modules.md#linear-memory-section)
@@ -228,6 +233,7 @@ The import section declares all imports that will be used in the module.
228233
| entries | `import_entry*` | repeated import entries as described below |
229234

230235
#### Import entry
236+
231237
| Field | Type | Description |
232238
| ----- | ---- | ----------- |
233239
| module_len | `varuint32` | module string length |
@@ -330,6 +336,7 @@ The encoding of the [Export section](Modules.md#exports):
330336
| entries | `export_entry*` | repeated export entries as described below |
331337

332338
#### Export entry
339+
333340
| Field | Type | Description |
334341
| ----- | ---- | ----------- |
335342
| field_len | `varuint32` | field name string length |

DynamicLinking.md

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ achieved by having module A export functions, tables and memories that are
2020
imported by B. A C++ toolchain can expose this functionality by using the
2121
same function attributes currently used to export/import symbols from
2222
native DSOs/DLLs:
23+
2324
```
2425
#ifdef _WIN32
2526
# define EXPORT __declspec(dllexport)
@@ -34,15 +35,19 @@ typedef void (**PF)();
3435
IMPORT PF imp();
3536
EXPORT void exp() { (*imp())(); }
3637
```
38+
3739
This code would, at a minimum, generate a WebAssembly module with imports for:
40+
3841
* the function `imp`
3942
* the heap used to perfom the load, when dereferencing the return value of `imp`
4043
* the table used to perform the pointer-to-function call
4144

4245
and exports for:
46+
4347
* the function `exp`
4448

4549
A more realistic module using libc would have more imports including:
50+
4651
* an immutable `i32` global import for the offset in linear memory to place
4752
global [data segments](Modules.md#data-section) and later use as a constant
4853
base address when loading and storing from globals
@@ -57,6 +62,7 @@ toolchain to put implementation-internal names in a separate namespace, avoiding
5762
the need for `__`-prefix conventions).
5863

5964
To implement run-time dynamic linking (e.g., `dlopen` and `dlsym`):
65+
6066
* `dlopen` would compile and instantiate a new module, storing the compiled
6167
instance in a host-environment table, returning the index to the caller.
6268
* `dlsym` would be given this index, pull the instance out of the table,

Events.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Past
1+
## Past Events
22

33
| Date | Title | Slides | Video | Presenter(s) |
44
|-----:|-------|:------:|:-----:|--------------|

FeatureTest.md

+4
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ like.
1313
Since some WebAssembly features add operators and all WebAssembly code in a
1414
module is validated ahead-of-time, the usual JavaScript feature detection
1515
pattern:
16+
1617
```
1718
if (foo)
1819
foo();
1920
else
2021
alternativeToFoo();
2122
```
23+
2224
won't work in WebAssembly (if `foo` isn't supported, `foo()` will fail to
2325
validate).
2426

@@ -68,6 +70,7 @@ that one function was an optimized, but feature-dependent, version of another
6870
function (similar to the
6971
[`ifunc` attribute](https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Function-Attributes.html#index-g_t_0040code_007bifunc_007d-attribute-2529),
7072
but without the callback):
73+
7174
```
7275
#include <xmmintrin.h>
7376
void foo(...) {
@@ -85,6 +88,7 @@ void foo_f64x2(...) __attribute__((optimizes("foo","f64x2"))) {
8588
...
8689
foo(...); // calls either foo or foo_f64x2
8790
```
91+
8892
In this example, the toolchain could emit both `foo` and `foo_f64x2` as
8993
function definitions in the "specific layer" binary format. The load-time
9094
polyfill would then replace `foo` with `foo_f64x2` if

FutureFeatures.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Feature to add after the MVP
1+
# Features to add after the MVP
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
@@ -14,6 +14,7 @@ This is covered in the [tooling](Tooling.md) section.
1414
## Finer-grained control over memory
1515

1616
Provide access to safe OS-provided functionality including:
17+
1718
* `map_file(addr, length, Blob, file-offset)`: semantically, this operator
1819
copies the specified range from `Blob` into the range `[addr, addr+length)`
1920
(where `addr+length <= memory_size`) but implementations are encouraged
@@ -51,19 +52,21 @@ can allocate noncontiguous virtual address ranges. See the
5152

5253
Some platforms offer support for memory pages as large as 16GiB, which
5354
can improve the efficiency of memory management in some situations. WebAssembly
54-
may offer programs the option to specify a larger page size than the [default] (Semantics.md#resizing).
55+
may offer programs the option to specify a larger page size than the [default](Semantics.md#resizing).
5556

5657
## More expressive control flow
5758

5859
Some types of control flow (especially irreducible and indirect) cannot be
5960
expressed with maximum efficiency in WebAssembly without patterned output by the
6061
relooper and [jump-threading](https://en.wikipedia.org/wiki/Jump_threading)
6162
optimizations in the engine. Target uses for more expressive control flow are:
63+
6264
* Language interpreters, which often use computed-`goto`.
6365
* Functional language support, where guaranteed tail call optimization is
6466
expected for correctness and performance.
6567

6668
Options under consideration:
69+
6770
* No action, `while` and `switch` combined with jump-threading are enough.
6871
* Just add `goto` (direct and indirect).
6972
* Add new control-flow primitives that address common patterns.
@@ -403,6 +406,7 @@ can begin.
403406

404407
There are two future features that would allow streaming compilation
405408
of WebAssembly in browsers:
409+
406410
* [ES6 Module integration](Modules.md#integration-with-es6-modules) would allow
407411
the browser's network layer to feed a stream directly into the engine.
408412
* The asynchronous [`WebAssembly.compile`](JS.md#wasmcompile) function could be
@@ -444,6 +448,7 @@ it was possible to write a WebAssembly dynamic loader in WebAssembly. As a
444448
prerequisite, WebAssembly would need first-class support for
445449
[GC references](GC.md) on the stack and in locals. Given that, the following
446450
could be added:
451+
447452
* `get_table`/`set_table`: get or set the table element at a given dynamic
448453
index; the got/set value would have a GC reference type
449454
* `grow_table`: grow the current table (up to the optional maximum), similar to
@@ -453,6 +458,7 @@ could be added:
453458
Additionally, in the MVP, the only allowed element type of tables is a generic
454459
"anyfunc" type which simply means the element can be called but there is no
455460
static signature validation check. This could be improved by allowing:
461+
456462
* functions with a particular signature, allowing wasm generators to use
457463
multiple homogeneously-typed function tables (instead of a single
458464
heterogeneous function table) which eliminates the implied dynamic signature

GC.md

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
After the [MVP](MVP.md), to realize the [high-level goals](HighLevelGoals.md)
44
of (1) integrating well with the existing Web platform and (2) supporting
55
languages other than C++, WebAssembly needs to be able to:
6+
67
* reference DOM and other Web API objects directly from WebAssembly code;
78
* call Web APIs (passing primitives or DOM/GC/Web API objects) directly from
89
WebAssembly without calling through JavaScript; and
@@ -59,6 +60,7 @@ in a Web environment.
5960
Using [opaque reference types](GC.md#opaque-reference-types),
6061
JavaScript values could be made accessible to WebAssembly code through a builtin
6162
`js` module providing:
63+
6264
* an exported `string` opaque reference type and exported functions
6365
to allocate, query length, and index `string` values;
6466
* an exported `object` opaque reference type and exported functions
@@ -81,6 +83,7 @@ Using [opaque reference types](GC.md#opaque-reference-types), it would be
8183
possible to allow direct access to DOM and Web APIs by mapping their
8284
[WebIDL](http://www.w3.org/TR/WebIDL) interfaces to WebAssembly builtin module
8385
signatures. In particular:
86+
8487
* WebIDL interfaces (like
8588
[WebGLRenderingContextBase](https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14)
8689
or [WebGLTexture](https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.9))
@@ -110,6 +113,7 @@ would effectively be skipped.
110113

111114
Another important issue is mapping WebIDL values types that aren't simple
112115
[primitive types](http://www.w3.org/TR/WebIDL/#dfn-primitive-type):
116+
113117
* [Dictionary types](http://www.w3.org/TR/WebIDL/#idl-dictionary)
114118
would [appear](http://www.w3.org/TR/WebIDL/#es-dictionary) to require
115119
JavaScript objects but are actually defined as values such that they can
@@ -144,6 +148,7 @@ direct GC allocation and field access from WebAssembly code through
144148

145149
There is a lot of the design left to
146150
consider for this feature, but a few points of tentative agreement are:
151+
147152
* To avoid baking in a single language's object model, define low-level GC
148153
primitives (viz., structs and arrays) and allow the source language compiler
149154
to build up features like virtual dispatch and access control.

0 commit comments

Comments
 (0)