Make Rust ABI stable enough to provide plugins functionality #1675
Labels
T-compiler
Relevant to the compiler team, which will review and decide on the RFC.
T-dev-tools
Relevant to the development tools team, which will review and decide on the RFC.
T-lang
Relevant to the language team, which will review and decide on the RFC.
Each language has it's own rules of creating a plugins.
In java we can make a project which may open a
.jar
at runtime to extend the program functionality. Inpython
we could do almost the same thing using native tools. InC++
with Qt we can create aQPlugin
/QLibrary
which does the same thing. InC
we may simply usedlopen
.Now creating an extensible application in rust is problematic:
extern "Rust"
is not safe yet too if you switch between compiler versions.Even if I did not provide much items above, creating a plugin in Rust is very hard and needs a lot of unsafe blocks, checks, hacks and simulations (for example,
trait-object simulation
). Also everything needs to beC
-compliant. As a language user I see that language attempts to be the most simple and safe as possible at the same time. It should have an ability to extend the program's functionality during runtime without usingC
convention - that would help to avoidunsafe
blocks.Original question was discussed here:
https://users.rust-lang.org/t/how-to-write-plugins-in-rust/
Here and here is some use of hacky-like code to emulate plugin functionality. I believe it works but this is absolutely weird - coding in
Rust
forRust
withC
convention. We must provide a way to make normal, human-oriented way to extendRust
programs inRust
language without any narrowing toC
.P.S. I did not make any RFC yet.
The text was updated successfully, but these errors were encountered: