27 releases (stable)

1.7.0 Nov 26, 2024
1.6.1 Sep 28, 2024
1.4.2 Jul 2, 2024
1.1.1 Feb 12, 2024
0.1.0 Dec 26, 2023

#992 in Magic Beans

Download history 242/week @ 2024-08-20 237/week @ 2024-08-27 199/week @ 2024-09-03 207/week @ 2024-09-10 219/week @ 2024-09-17 893/week @ 2024-09-24 312/week @ 2024-10-01 306/week @ 2024-10-08 347/week @ 2024-10-15 268/week @ 2024-10-22 191/week @ 2024-10-29 355/week @ 2024-11-05 130/week @ 2024-11-12 158/week @ 2024-11-19 373/week @ 2024-11-26 446/week @ 2024-12-03

1,123 downloads per month
Used in 6 crates (via gear-core-backend)

GPL-3.0 license

110KB
2K SLoC

This crate provides means to instantiate and execute wasm modules.

It works even when the user of this library executes from inside the wasm VM. In this case the same VM is used for execution of both the sandbox owner and the sandboxed module, without compromising security and without the performance penalty of full wasm emulation inside wasm.

This is achieved by using bindings to the wasm VM, which are published by the host API. This API is thin and consists of only a handful functions. It contains functions for instantiating modules and executing them, but doesn't contain functions for inspecting the module structure. The user of this library is supposed to read the wasm module.

When this crate is used in the std environment all these functions are implemented by directly calling the wasm VM.

Examples of possible use-cases for this library are not limited to the following:

  • implementing program runtimes that use Wasm for contract code
  • executing a wasm substrate runtime inside of a wasm parachain

Dependencies

~14–31MB
~520K SLoC