That’s a similar plugin architecture to what I’m doing with
mdbook, except instead of doing it at a binary level (where each library has a known entry point like
start), a “plugin” is an executable which receives input via stdin and writes output to stdout. Here’s the chapter from the user guide explaining how this works.
Otherwise in my FFI guide I go through a more similar use case in great detail, where you’re using
dlopen() and the plugin exposes a known C API and your application loads that DLL/Shared Object at runtime.
I think your recompiling method and calling a custom
start function may be a little inflexible, seeing as you essentially need to recompile a
main.rs for every plugin library.