Advanced

Plugin Block

High-performance custom logic compiled to WebAssembly (Rust, C++, Zig)

Open Plugin in BlockWerk →

# Technical Manual: WASM Plugin Block (v4)

The WASM Plugin Block is the ultimate tool for high-performance simulation logic. It allows you to run native-speed models compiled from languages like Rust, C++, Zig, or Go directly within the BlockWerk engine.

🚀 Key Features

1. Native Simulation Performance

Unlike interpreted scripts, WASM plugins run at near-native CPU speeds. This makes them ideal for:

2. Standardized ABI (v1)

To integrate with BlockWerk, your WASM module should export a step function with the following signature:

3. Dynamic Port Mapper

Easily map your WASM function arguments to the BlockWerk canvas:

🏗️ Getting Started

1. Compile your model: Ensure your language compiler targets wasm32-unknown-unknown (or wasm32-wasi with shim). 2. Expose the step function: #[no_mangle] pub extern "C" fn step(t: f64, dt: f64, in1: f64) -> f64 { ... } 3. Host the binary: Upload your .wasm file to a URL or your project assets. 4. Connect in BlockWerk: Provide the URL in the Plugin IDE and define your ports.

💡 Best Practices