╔══════════════════════════════════════════════════════════════════════════════════════╗ ║ ║ ║ ██████╗ ██╗ ██╗██╗ ██╗ ███████╗██╗ ██████╗ ██╗ ██╗████████╗███████╗██████╗ ║ ║ ██╔════╝ ██║ ██║╚██╗ ██╔╝ ██╔════╝██║██╔════╝ ██║ ██║╚══██╔══╝██╔════╝██╔══██╗ ║ ║ ██║ ███╗██║ ██║ ╚████╔╝ █████╗ ██║██║ ███╗███████║ ██║ █████╗ ██████╔╝ ║ ║ ██║ ██║██║ ██║ ╚██╔╝ ██╔══╝ ██║██║ ██║██╔══██║ ██║ ██╔══╝ ██╔══██╗ ║ ║ ╚██████╔╝╚██████╔╝ ██║ ██║ ██║╚██████╔╝██║ ██║ ██║ ███████╗██║ ██║ ║ ║ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ║ ║ ║ ║ ║ ║ ║ ║ 🥊 ULTIMATE EDITION 🥊 ║ ╚══════════════════════════════════════════════════════════════════════════════════════╝
A demonstration of a plugin system using WASM Components.
Guy Fighter is a console application that lets you simulate fights between different types of guys. Plugins can be written and loaded into Guy Fighter to invent entirely new types of guys to fight.
Guy Fighter consists of four components:
- A host console application, written in Rust
- A Deluxe Dog plugin, written in C
- A Coffee Guy plugin, written in JavaScript
- An interface definition file that defines the communication between these components, written in WIT
The host application embeds the Wasmtime WASM runtime. The plugins are compiled to WASM components and run inside the WASM sandbox, communicating with the host through a limited interface defined in the WIT file.
- wasi-sdk for building the C plugin
- NodeJS for building the JS plugin
- ComponentizeJS for building the JS plugin
- Rust for building host application
$ make runThis builds the host application, C and JS plugins, and runs Guy Fighter.