diff options
| author | Luke Wagner <mail@lukewagner.name> | 2015-06-12 11:15:41 -0500 |
|---|---|---|
| committer | Luke Wagner <mail@lukewagner.name> | 2015-06-12 11:15:41 -0500 |
| commit | bba8bdb191cfce8b8b7fb93621b5df0353034f2c (patch) | |
| tree | e0761788009b005cc9a380cfebe426672d610af8 | |
| parent | 4cb469bdd1eaaaf0ee6c54b69e10da48823fccc1 (diff) | |
| parent | e7d0d9625742c32888710c4a724fe5651e2826a3 (diff) | |
| download | nanowasm-design-bba8bdb191cfce8b8b7fb93621b5df0353034f2c.tar.gz | |
Merge pull request #152 from WebAssembly/update-portable-api-para
Update API portability paragraph
| -rw-r--r-- | Portability.md | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/Portability.md b/Portability.md index 2d6991a..e94db71 100644 --- a/Portability.md +++ b/Portability.md @@ -4,6 +4,8 @@ WebAssembly's [binary format](BinaryEncoding.md) is designed to be executable efficiently on a variety of operating systems and instruction set architectures, [on the Web](Web.md) and [off the Web](NonWeb.md). +## Assumptions for Efficient Execution + Execution environments which, despite [limited, local, non-determinism](Nondeterminism.md), don't offer the following characteristics may be able to execute WebAssembly modules @@ -38,11 +40,20 @@ characteristics: * An execution environment which offers forward progress guarantees to all threads of execution (even when executing in a non-parallel manner). -Developer-exposed APIs (such as POSIX) are expected to be portable at a -source-code level through WebAssembly libraries which will use -[feature detection](FeatureTest.md). These libraries aren't necessarily -standardized: WebAssembly will follow the -[extensible web manifesto](https://extensiblewebmanifesto.org)'s lead and expose -low-level capabilities that expose the possibilities of the underlying platform -as closely as possible. WebAssembly therefore standardizes a lower-level -abstraction layer, and expects libraries to offer portable APIs. +## API + +WebAssembly does not specify any APIs or syscalls, only an +[import mechanism](MVP.md#modules) where the set of available imports is defined +by the host environment. In a [Web](Web.md) environment, functionality is +accessed through the Web APIs defined by the +[Web Platform](https://en.wikipedia.org/wiki/Open_Web_Platform). +[Non-Web](NonWeb.md) environments can choose to implement standard Web APIs, +standard non-Web APIs (e.g. POSIX), or invent their own. + +## Source-level + +Portability at the C/C++ level can be achieved by programming to +a standard API (e.g., POSIX) and relying on the compiler and/or libraries to map +the standard interface to the host environment's available imports either at +compile-time (via `#ifdef`) or run-time (via [feature detection](FeatureTest.md) +and dynamic [loading](MVP.md#modules)/[linking](FutureFeatures.md#dynamic-linking)). |
