Hacker News new | ask | show | jobs
by reacharavindh 2942 days ago
Yes, I'm not constrained in any way to not be able to run a 5 MB binary. I was curious if that was an indication of what is to come for large projects...

I guess I was tangentially pointing to complexity and abstraction there.

1 comments

rust doesn't use dynamic linking, which contributes a lot to that size.
Wont a crate compiled with 'crate_type = "dylib"' be dynamically linked if you specify '-C prefer-dynamic' when compiling your program?

https://doc.rust-lang.org/reference/linkage.html

This is pedantic, but rust does link dynamically, but only to libc.
It can, but for practical reasons, generally does not. For Rust code anyway; often anything bound via FFI is dynamically linked.