forked from WebAssembly/WASI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit reworks how handle types work at the representation level in `*.witx` file to follow the expected design of resources in the interface types specification. Previously handle types were simply `(handle)`, which meant that there could only be one actual handle type in the world (structurally at least). After this commit, however, there can be multiple handle types. First abstract types must be introduced as a `resource`, for example: (resource $fd) This declares that the module exports a type named `$fd` and it's abstract in that the representation is not known. At the interface layer you can't pass an `$fd` directly because it's representation is not known. To do that, however, you can do: (param $x (handle $fd)) The `handle` type now refers to a particular `resource` that it refers to. Values of type `handle T` can exist and are what's passed at the boundaries. This is all largely just an internal structuring concern at this point. This has no ramifications for WASI which still has an `$fd` type for functions that is represented with an `i32`. This is largely a forward-looking change to allow multiple types of resources defined by different modules and all used by one another. This commit also updates `use` syntax where `use` will pull from either the type or the resource namespace. Furthermore a new `(use ($foo as $bar) ...)` syntax was added to locally renamed something within a module.
- Loading branch information
1 parent
fc3da39
commit 834679b
Showing
13 changed files
with
252 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.