Packaging Rust for Fedora
Packaging Rust for Fedora
Posted Oct 30, 2022 17:09 UTC (Sun) by ssokolow (guest, #94568)In reply to: Packaging Rust for Fedora by khim
Parent article: Packaging Rust for Fedora
There is no free lunch. Either you have ABI-stable standard library or shared libraries are, basically, impossible.Or you marshal your data in some way, like the abi_stable crate does for enabling
dlopen
-able libraries using higher-level Rust constructs via Rust-Rust FFI through the C ABI.
And it's not as if Rust standard library can do sudden, radical, changes. It just wasn't in use for as long as C++ one.The Rust standard library has two advantages over C++ on that front:
- Static linking and no stable ABI (eg. Rust 1.0 didn't do automatic structure packing. That was added later.)
- Stronger API encapsulation (Rust has already done things C++ balked at, such as Rust 1.36 swapping out its original, slower
HashMap
implementation for a vendored copy of a port of Google's SwissTable. There's currently a PR being refined to replace the internals ofstd::sync::mpsc
with a vendored copy ofcrossbeam-channel
.)