Replies: 1 comment
-
For the sake of this question I'll assume you are asking about the specification of the (yet to be fully ratified) WASI Preview 2. Type signatures of interface functions are specified in the The WASI and Component Model proposals are specifications written by and for engine and guest language implementors. If you are just wanting to understand how to use existing tools, rather than write your own from scratch, the Bytecode Alliance maintains some docs aimed towards users at https://component-model.bytecodealliance.org/. The low level concepts in the Component Model specification, such as parsing wit, parsing and serializing the component binary and wat text formats, and programmatic (Rust) use of resolved types, functions, interfaces, and worlds, have a mature implementation in the wasm-tools repository https://github.com/bytecodealliance/wasm-tools. Using and reading the source for those implementations may help you understand the spec. The next layer up the stack in is guest language bindings generation, implemented for several different languages in the wit-bindgen repository https://github.com/bytecodealliance/wit-bindgen. If you are interested in how host implementations of components work, right now the most mature implementations are in the wasmtime crate https://github.com/bytecodealliance/wasmtime/tree/main/crates/wasmtime/src/component and the jco project https://github.com/bytecodealliance/jco. Other implementations are in the works as well, but I don't believe they are mature enough to examine yet. |
Beta Was this translation helpful? Give feedback.
-
Trying to implement a for now toy language which targets wasm with no middleman.
I find that the WASI could use a more formal specification on type signatures for interface functions and data layout of compound types like strings, and a description on, what the expected behaviour of those functions are.
It would definitely help implementation with respect to using WASM as a compiler target and also consistency in interpreters for wasm.
Beta Was this translation helpful? Give feedback.
All reactions