Pre-RFC: Runtime reflection

I disagree. While dynamic linking does have some cost associated with it, it is a useful abstraction, and Rust supports lots of non-zero-cost abstractions. So while Rust does static linking by default (and gains some performance benefits through it) doesn't mean we should take dynamic linking off the table solely for performance reasons.

The war thing for example seems really close to a plugin system, and I know there's demand for that, and I don't think we want to ban plugins just because static linking is more dynamic.

Coming back to the topic at hand though, I do think for war/plugin loading schemas that even bigger than runtime reflection is a stable ABI. Or at least, a stable ABI is required either way, and there are ways to accomplish it the loading without runtime reflection. (And you can currently get around the unstable ABI by using stuff like repr(c), no_mangle, extern etc.)

Most importantly, you can do stuff like that today if you want with no new language features required, see for example https://michael-f-bryan.github.io/rust-ffi-guide/dynamic_loading.html

6 Likes