3 ms·
I'd love to see some details on what you encountered while adding dynamic loading. There are a lot of decisions to make. In python, importing a package executes
by cdcarter 3y ago
I'd love to see some details on what you encountered while adding dynamic loading. There are a lot of decisions to make. In python, importing a package executes the static blocks. In the JVM, import doesn't have a side effect but the first actual usage causes statics to run. Similarly you need to decide what you'll do with conflicting names. Namespaces? last one wins?
- nbittich 3y agoThank you for your interest! It wasn't too hard to be honest, the actual tradeoff is that the shared object must have been built with the same version of rust that was used to build the runtime(see https://github.com/nbittich/adana#plugins https://github.com/nbittich/adana#plugins) for the way it's loaded, it's like in nodejs with common modules: my_lib = require("/path/to/my_lib.so") or for standard lib: fs = require("@std/fs")
- slaymaker1907 3y agoIt also executes a bunch of code in C++ (at least for Windows) and can do all sorts of wild stuff. It happens when you define globals with constructors that the compiler can't/doesn't optimize away.