External Publication
Visit Post

[Pre-Pre-RFC] Dynamic library proposal

Rust Internals [Unofficial] April 5, 2026
Source

LouChiSoft:

So where does Rust fit in? Well I think the same pattern could be applied to Rust as well when compiling dynamic libraries. Only instead of getting a platform specific .lib file you get something like a .rimport file or something. similar. The goal would be that during compilation of the library every publicly accessible symbol you have would be exported into the .rimport file along with the ABI that it was compiled with. No fixed ABI here, just the one that toolchain used at the time it was compiled.

Good news: these files already exist. They are called metadata files, with extension .rmeta. They contain exactly the information that the compiler of some dependent code needs in order to compile against the library.[1]

So, you don’t need to invent a new file format; you “just” need:

  • sufficient ABI stability/versioning, and
  • a way to tell Cargo to accept a pre-existing .rmeta rather than compiling all dependencies from source.

  1. Note that some of this information is things like “the bodies of inlinable functions”, so you might need to prohibit inlining if you want the dynamic library to be separately updateable. ↩︎

Discussion in the ATmosphere

Loading comments...