Just realized that dynamic libraries are only really useful if we can't assume that code will be safe and thus we need to regularly update them for all the software they're used on.
Take the security risk away, and whatever storage savings you get by dynamic linking seem to be shadowed by how hard to manage they can be, the performance overhead they can cause and the *extra* security issues they can allow.
@espectalll but it's not just storage savings, it's RAM savings too. Apparently libgobject is mmaped into 105 processes on my system right now; imagine if each process used its own copy (hello Electron)
@bugaevc yeah, you're right - I imagine a better world where that would make people optimize for RAM, but yeah, that ain't happening...
@espectalll I also like to think that shared libraries — and Android's Zygote — is how we get something resembling zero-cost abstractions in OS design. I.e. if there was no processes and no separate address spaces, every piece of code would just use one copy of a library; with shared libs they're still using one copy but they behave as if each had its own separate copy.
@bugaevc well, perhaps, definitely not zero-cost but "less cost", let's say.
I'm wondering this, by the way, because of the trend in languages like Rust, Go and Crystal to statically link everything
@espectalll yeah, and I'm one of those people who strongly dislike this trend. You can tell Rust (and others I believe too) to prefer dynamic linking though