|0.2.86||May 15, 2023|
|0.2.84||Feb 1, 2023|
|0.2.83||Sep 12, 2022|
|0.2.82||Jul 25, 2022|
|0.2.28||Nov 12, 2018|
#146 in WebAssembly
43,416 downloads per month
Used in 23 crates (via wasm-bindgen-cli-support)
A tiny and incomplete wasm interpreter
This module contains a tiny and incomplete wasm interpreter built on top of
walrus's module structure. Each
Interpreter contains some state
about the execution of a wasm instance. The "incomplete" part here is
related to the fact that this is only used to execute the various
descriptor functions for wasm-bindgen.
As a recap, the wasm-bindgen macro generate "descriptor functions" which
basically as a mapping of rustc's trait resolution in executable code. This
allows us to detect, after the macro is invoke, what trait selection did and
what types of functions look like. By executing descriptor functions they'll
each invoke a known import (with only one argument) some number of times,
which gives us a list of
u32 values to then decode.
The interpreter here is only geared towards this one exact use case, so it's quite small and likely not extra-efficient.