Rust Application with Plugins Funtionality

I'm writing a software with Rust due to speed and safety advantage compared to alternatives. One of the main feature of the software is to have plugins support, so someone could write a rust code and the software would use that code (lib) located under for example plugins directory.
I guess the way is to use library files, for example .dll on Windows and .so on Linux.

Do you a recommendation how should I structure the project and how approach this goal?

Any advice would help a lot!

One option to consider is having the plugins be WebAssembly (.wasm) rather than native shared libraries (.dll or .so):

Multiple languages can be compiled to WASM, and it should offer security and portability benefits (it's more sandboxed and cross-platform), although it may not be quite mature yet (others could comment more knowledgeably on whether it is).

I understand that the main WASM engines for Rust are Wasmer and Wasmtime:

1 Like

Check this out Dynamic Loading & Plugins - The (unofficial) Rust FFI Guide

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.