mirror of
https://github.com/fluencelabs/interface-types
synced 2024-12-12 11:05:31 +00:00
e078099687
1362: feat(interface-types) Remove allocator index from `string.lower_memory` r=Hywan a=Hywan This PR updates `string.lower_memory` to remove the allocator index. Indeed, the string pointer is assumed to be present on the stack. Also, this PR updates `string.size` to pop, and not to peek, the string to compute the length from. That way, it matches the WIT proposal. Co-authored-by: Ivan Enderlin <ivan@mnt.io> |
||
---|---|---|
src | ||
tests | ||
Cargo.toml | ||
README.md |
Wasmer Interface Types
Wasmer is a standalone JIT WebAssembly runtime, aiming to be fully compatible with WASI, Emscripten, Rust and Go. Learn more.
This crate is an implementation of the living WebAssembly Interface Types standard.
Encoders and decoders
The wasmer-interface-types
crate comes with an encoder and a decoder
for the WAT format, and the binary format, for the WebAssembly
Interface Types. An encoder writes an AST into another format, like
WAT or binary. A decoder reads an AST from another format, like WAT or
binary.
Instructions
Very basically, WebAssembly Interface Types defines a set of instructions, used by adapters to transform the data between WebAssembly core and the outside world (learn mode).
Here is the instructions that are implemented by this crate:
Instruction | WAT encoder/decoder | Binary encoder/decoder | Interpreter | Comment |
---|---|---|---|---|
arg.get |
✅ | ✅ | ✅ | |
call-core |
✅ | ✅ | ✅ | |
s8.from_i32 |
✅ | ✅ | ✅ | |
s8.from_i64 |
✅ | ✅ | ✅ | |
s16.from_i32 |
✅ | ✅ | ✅ | |
s16.from_i64 |
✅ | ✅ | ✅ | |
s32.from_i32 |
✅ | ✅ | ✅ | |
s32.from_i64 |
✅ | ✅ | ✅ | |
s64.from_i32 |
✅ | ✅ | ✅ | |
s64.from_i64 |
✅ | ✅ | ✅ | |
i32.from_s8 |
✅ | ✅ | ✅ | |
i32.from_s16 |
✅ | ✅ | ✅ | |
i32.from_s32 |
✅ | ✅ | ✅ | |
i32.from_s64 |
✅ | ✅ | ✅ | |
i64.from_s8 |
✅ | ✅ | ✅ | |
i64.from_s16 |
✅ | ✅ | ✅ | |
i64.from_s32 |
✅ | ✅ | ✅ | |
i64.from_s64 |
✅ | ✅ | ✅ | |
u8.from_i32 |
✅ | ✅ | ✅ | |
u8.from_i64 |
✅ | ✅ | ✅ | |
u16.from_i32 |
✅ | ✅ | ✅ | |
u16.from_i64 |
✅ | ✅ | ✅ | |
u32.from_i32 |
✅ | ✅ | ✅ | |
u32.from_i64 |
✅ | ✅ | ✅ | |
u64.from_i32 |
✅ | ✅ | ✅ | |
u64.from_i64 |
✅ | ✅ | ✅ | |
i32.from_u8 |
✅ | ✅ | ✅ | |
i32.from_u16 |
✅ | ✅ | ✅ | |
i32.from_u32 |
✅ | ✅ | ✅ | |
i32.from_u64 |
✅ | ✅ | ✅ | |
i64.from_u8 |
✅ | ✅ | ✅ | |
i64.from_u16 |
✅ | ✅ | ✅ | |
i64.from_u32 |
✅ | ✅ | ✅ | |
i64.from_u64 |
✅ | ✅ | ✅ | |
string.lift_memory |
✅ | ✅ | ✅ | #memidx is not supported; #encoding is not supported but UTF-8 is assumed |
string.lower_memory |
✅ | ✅ | ✅ | #memidx is not supported; #encoding is not supported but UTF-8 is assumed |
string.size |
✅ | ✅ | ✅ | #encoding is not supported but UTF-8 is assumed |
record.lift |
✅ | ✅ | ✅ | |
record.lower |
✅ | ✅ | ✅ | |
call-adapter |
❌ | ❌ | ❌ | |
defer-call-core |
❌ | ❌ | ❌ |