[][src]Crate wasmer_interface_types

This crate contains an implementation of WebAssembly Interface Types (abbreviated WIT). It is composed of 4 parts:

  1. AST: To represent the WIT language as a tree (which is not really abstract). This is the central representation of the language.
  2. Decoders: To read the AST from a particular data representation; for instance, decoders::binary reads the AST from a binary.
  3. Encoders: To write the AST into a particular format; for instance, encoders::wat writes the AST into a string representing WIT with its textual format.
  4. Interpreter: WIT defines a concept called Adapters. An adapter contains a set of instructions. So, in more details, this module contains:
    • A very light and generic stack implementation, exposing only the operations required by the interpreter,
    • A stack-based interpreter, defined by:
      • A compiler that transforms a set of instructions into a set of executable instructions,
      • A stack,
      • A runtime that holds the “invocation inputs” (arguments of the interpreter), the stack, and the WebAssembly instance (which holds the exports, the imports, the memories, the tables etc.),
    • An hypothetic WebAssembly runtime, represented as a set of enums, types, and traits —basically this is the part a runtime should take a look to use the wasmer-interface-types crate—.

Modules

ast

Represents the WIT language as a tree. This is the central representation of the language.

decoders

Reads the AST from a particular data representation; for instance, decoders::binary reads the AST from a binary.

encoders

Writes the AST into a particular format; for instance, encoders::wat writes the AST into a string representing WIT with its textual format.

interpreter

A stack-based interpreter to execute instructions of WIT adapters.