Hacker News new | ask | show | jobs
by brundolf 1732 days ago
Is dynamically linking Rust's standard library officially-supported or did you have to hack around that? I know static-linking is the default but I've never looked into doing otherwise
1 comments

The flag to dynamically link dependencies exists, and is part of the compiler's stable flags, but I'm not sure how much it's actually used, or how well it actually works.
Hmm, an LWN comment posted on the Debian wiki claims there are ABI stability issues, but they are being worked on:

https://lwn.net/Articles/797616/ https://wiki.debian.org/StaticLinking#Rust

Correct, the ABI is not stable. Given that they build a base system with a single rustc, that's not an immediate concern, though of course, a more stable ABI helps dynamic linking be more relevant.
The problem they'll have is that they don't update the whole system atomically, so the generations of different packages may be different.

A distribution like Clear or Nix could probably wrangle things appropriately.

Rust's stable ABI is the C ABI. I don't really see this changing in the foreseeable future.
It works well in terms of programs working. It has similar challenges to C++ that various commonly used abstractions end up producing a lot of code on the program side regardless. It's nonetheless worthwhile, if you have enough programs and resource constraints.