wasmer-interface-types-fl

WebAssembly Interface Types library for Wasmer

44 releases

0.28.0 Jan 25, 2024
0.27.0 Nov 2, 2023
0.26.1 Mar 21, 2023
0.24.1 Sep 12, 2022
0.17.0 Jul 28, 2020
Download history 183/week @ 2024-06-17 331/week @ 2024-06-24 115/week @ 2024-07-01 135/week @ 2024-07-08 348/week @ 2024-07-15 572/week @ 2024-07-22 489/week @ 2024-07-29 350/week @ 2024-08-05 343/week @ 2024-08-12 174/week @ 2024-08-19 302/week @ 2024-08-26 205/week @ 2024-09-02 314/week @ 2024-09-09 319/week @ 2024-09-16 393/week @ 2024-09-23 215/week @ 2024-09-30

1,258 downloads per month
Used in 36 crates (14 directly)

MIT license

290KB
7K SLoC

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

  1. Types and Values: To represent the WIT types and values representations,
  2. AST: To represent the WIT language as a tree (which is not really abstract). This is the central representation of the language.
  3. Decoders: To read the AST from a particular data representation; for instance, decoders::binary::parse reads the AST from a binary.
  4. 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.
  5. 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—.

Dependencies

~3.5–5MB
~99K SLoC