Lines Matching refs:plugins

4 to create an application that uses plugins.
5 The plugins are WebAssembly components.
7 …source code online](https://github.com/bytecodealliance/wasmtime/blob/main/examples/wasip2-plugins)
12 … Native Plugin Systems with WebAssembly Components "](https://tartanllama.xyz/posts/wasm-plugins/).
14 and using plugins.
23 target/release/calculator --plugins plugins/ add 1 2
29 target/release/calculator --plugins plugins/ subtract -1 -2
32 The set of operations available is defined by the set of plugins present in
33 the `plugins/` directory.
41 Two example plugins are included: an `add` plugin implemented in C,
43 Running `cargo build --release` will generate the plugins:
46 `plugins/` directory that you provide with the `--plugins` option.
48 > To build the plugins, you must install `wit-bindgen` and the WASI SDK
58 To define the interface for the plugins, we have to create a `.wit` file.
100 ## Loading plugins
103 which is expected to contain plugins (as .wasm files).
104 All plugins in the directory are loaded eagerly.
114 Only one `Engine` is needed regardless of how many plugins
121 (plugins implement pure functions), so the state type is `()` (the unit type).
129 calculator application) that can be called by guests (in this case, plugins
134 The remaining code checks that the provided path for the plugins directory
140 anyhow::bail!("plugins directory does not exist");
178 to each unit of code and so it can't be re-used across different plugins.
263 ## Writing the plugins
265 So far we've assumed that the `plugins` directory is populated
266 with plugins for all the arithmetic operations we want.
267 How do we actually write the plugins?
271 As part of this sample application, two plugins are provided,
276 Any number of plugins could be added, compiled from any language that
283 application with dynamically loaded plugins.
290 The basic mechanism for loading plugins would still be the same,