Rust Plugin system
Today i created a dynamic plugin system in rust. It is a very simple system that allows you to load plugins at compile time. Wacky Plugins
How it works
it uses a build.rs
to discover the plugins at compile time and add them to the Cargo.toml
file. It then uses a macro to load the plugins at runtime.
And then you can use the plugins like this:
Why?
Having compile time checked plugins is great but having to recompile every time you want to add a plugin is not, but it may be worth it since you can use the full rust feature set async, all libraries, etc.
Limitations/Advantages
Advantages
- You dont have to use extern c and ffi
- A plugin is a trait and compile time checked
- Its cross platform
Limitations
- You have to recompile every time you add a plugin
- You can dynamically load plugins
- Plugins have to be written in rust