-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin system is not supported within the rust ecosystem itself #79
Comments
What exactly do you mean by "does not work"? |
I mean : the work exposed in your guide work well. But using this for a full modular rust only plugin system will not work that well : passing Rust structures form and to dynamic libs lead to undefined behavior because of the use of static references in various points in the std library. My small code here put a light on this rust-lang/rust#67179 and it seems that this issue will not be addressed soon rust-lang/rust#63338 (comment) |
Ah I think I need to make it clearer that when working with dynamic libraries you are constrained to a C-style API. It doesn't mean you can't use this pattern for dynamically loading Rust code, just that there are extra constraints on the interface between the host and plugin. For example, instead of the plugin passing a It's annoying, but considering Rust doesn't yet have a stable ABI or linkage story that's probably the best we can do 😞 |
Yes, i understood what you mean. It is a way to explore. For my case, my plan was to transfer a complex structure embedding crossbeam::channel, because of multi-threading around. However, yes, it would be nice to make this strong particularity more clearer in your guide. Rust has a strong future, i believe. This kind of problems will have their solutions in time. Wait and see... |
I was glad to find your article and applied it in my project. However, this does not work when passing structures around dynamic libraries.
For now, it sounds to me that the use case is only for foreign languages with only canonical structures around that.
See rust-lang/rust#67179 and so rust-lang/rust#63338 with this rust-lang/rust#63338 (comment)
Do you have any workaround for this, please ? Thanks!
The text was updated successfully, but these errors were encountered: