On 02/19/2013 12:48 PM, Benoit Jauvin-Girard wrote:
Greetings all,
Is there any word on wether Rust will support the dynamic loading and unloading of crates at runtime? If so, any documentation as to what's planned?

It will someday I hope, but nobody is working on it now. Simple bindings to dlopen etc., plus some name mangling code could be implemented quickly to create an unsafe dynamic loading system, but making dynamic loading safe (type-checked) is considerably harder. My current plan involves extracting metadata encoding and decoding, as well as a minimal set of type definitions from rustc to their own crate that depends only on libstd (maybe libsyntax). Then use that to do ... something, at runtime, to verify that loaded types match the expected types.

There are also some unknowns about merging dynamically loaded crate maps (runtime crate metadata) into the current execution environment, but I think they are minor.

This is a very worthy project, and even simple code for unsafe (cross-platform) dynamic loading would be warmly received I think.

Relevant issues:

* https://github.com/mozilla/rust/issues/458 - dynamic loading
* https://github.com/mozilla/rust/issues/2213 - extracting metadata code from the compiler
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to