top | item 39114553

(no title)

mischief6 | 2 years ago

not a rust programmer. can someone explain why this is in the final binary and not in a shared library?

discuss

order

simonask|2 years ago

The Rust compiler statically links everything into a single binary. This can be changed, but is generally discouraged as there are no ABI stability guarantees at this point.

zozbot234|2 years ago

You can use the C ABI if you want something stable, and there are custom crates that will help with translating from the Rust to the C ABI. (This also helps because the resulting shared objects can potentially be FFI'd with from any language, not just Rust. They might as well be plain C libraries as far as anyone is concerned, only with the usual Rust safety requirements.)