Open markmandel opened 3 years ago
I hadn't looked at stable_abi
closely before, it seems interesting and worth investigating. I think we should discuss what kind of behaviour we expect from the runtime loading. Here are a couple of open questions that come to mind.
dll
s adjacent to the running binary.stable_abi
doesn't support unloading for example.Where do we store the plugins?
My suggestion: make the folder to search (I'm assuming there may be more than one plugin loaded at once) configurable through the config yaml, but with a default of a separate relative directory from the main binary.
I'm inclined towards startup only for simplicity and security.
100% concur. Runtime replacement of code scares me. 😱
What context do we send across the FFI boundary?
I expect this will require experimenting with abi_stable_crates
and seeing what is possible, and how close it might come to our existing context data.
Side thought: Assuming all goes to plan with #411 -- would that make things harder to load an external plugin, as we no longer have a context object (or would we need to fabricate one just to allow external loading of code?) Again, might just require some experimentation to see what is possible.
https://robert.kra.hn/posts/hot-reloading-rust/
Was just reading this - based on work Bevy has been doing
Context:
Originally posted by @XAMPPRocky in https://github.com/googleforgames/quilkin/issues/401#issuecomment-934577495
This is an issue to track this idea, as I think it's definitely got value for sure. I'm sure @XAMPPRocky you know more about this than I do. I couldn't find a particularly clear guide.
Here are the resources I found: