Your First plugin

This example will use rust to build an new plugin for Floneum.

First, edit your cargo.toml to add floneum_rust and wit-bindgen as dependencies and change the crate type to a dynamically linked (C-like) library

crate-type = ["cdylib"]

floneum_rust = { git = "" }
wit-bindgen = { git = "", rev = "285f0c6ad5da3d6cd8ef2e0635df51f229d6578f" }

Then create your plugin with the export plugin macro:

use floneum_rust::*;

/// adds two numbers
fn add(first: i64, second: i64) -> i64 {
    first + second

Next, build your plugin:

cargo install --git floneum-cli
floneum build --release

You can look at the default plugins here to see how more complex plugins work

Finally, load your plugin by running the main Floneum application and typing the path to your .wasm file in the load plugin text box in the top left.