Skip to content

Commit aa3bc59

Browse files
authored
Add application-abi describing the current unstable WASI application ABI (#48)
1 parent 9e8f0d3 commit aa3bc59

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

design/application-abi.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
WASI Application ABI
2+
====================
3+
4+
In addition to the APIs defined by the various WASI [modules](modules.md) there
5+
are also certain expectations that the WASI runtime places on an application
6+
that wishes to be portable across WASI implementations.
7+
8+
This document describes how a conforming WASI application is expected to behave
9+
in terms of lifecycle (startup, shutdown, etc) and any exports it is expected to
10+
include.
11+
12+
Current Unstable ABI
13+
--------------------
14+
15+
The current WASI unstable ABI specifies only two exports from a WASI
16+
application:
17+
18+
- `_start` - the program entry point
19+
- `memory` - linear memory used by the program
20+
21+
The `_start` export must be WebAssembly function and will be used as the program
22+
entry point. This is the default name used by `lld` when linking WebAssembly
23+
modules. The embedder is expected to call this function once the module is
24+
instantiated.
25+
26+
Many of the current WASI unstable APIs require sharing of linear memory between
27+
the application and the embedder. In order to use any such APIs the WASI module
28+
is expected to export its linear memory under the name `memory`.
29+
30+
Planned Stable ABI
31+
------------------
32+
33+
There is ongoing discussion about what the stable ABI might look like:
34+
35+
- https://github.com/WebAssembly/WASI/issues/13
36+
- https://github.com/WebAssembly/WASI/issues/19
37+
- https://github.com/WebAssembly/WASI/issues/24

0 commit comments

Comments
 (0)