3 ms·
One good effect of dynamic linking is that you don't have to recompile all your binaries when it turns out a widely-used library has a gaping security hole. Dy
by parenthephobia 10y ago
One good effect of dynamic linking is that you don't have to recompile all your binaries when it turns out a widely-used library has a gaping security hole.
Dynamic linking is also more storage efficient. If the contents of my /bin were statically linked, it'd take up 76GB. With dynamic linking, the binaries and their libraries take up 4GB.
This also matters at run-time, if I'm not writing single-binary apps: a Unix pipeline of 8 50MB binaries, say, is taking up 400MB of cache just for the code. On a 1GB server, that's a big deal.
- pjmlp 10y ago> This also matters at run-time, if I'm not writing single-binary apps: a Unix pipeline of 8 50MB binaries, say, is taking up 400MB of cache just for the code. On a 1GB server, that's a big deal. Most likely not, all modern OSes do memory mapping for executable code. Regarding security, when implementing plugins, dynamic opens an application to security exploits in third party code. Hence why Apple, Google and Microsoft when back to the separate process model as container model.
- marssaxman 10y agoI can understand the security argument if you're running a server, but I'm not, and what I care about is predictability: I want the apps that have been working to keep on working in exactly the same way until such a day as I decide to take the risk of upgrading them. I don't care how foolproof semantic versioning might be in theory: in practice, sometimes you upgrade one thing and that leaves another thing broken, and this is not something I am willing to accept in a personal workstation - especially not as the result of an automated self-update process, introducing churn without bothering to get my permission! I don't care about storage efficiency. It's been years since I've had to pay any attention to drive capacity. 4GB is nothing. 76 GB is also nothing, when you have multiple terabytes of storage space sitting completely idle. As far as memory efficiency goes, I'm not running pipelines, so I don't care. On a server with 1GB RAM, yes, I can see that becoming a big deal; but even my laptops all have 8GB RAM now. On a personal workstation, this doesn't matter, and that's where I'd like to see the "link everything dynamically" meme die. I'm not a system administrator and I don't have system-administrator concerns. I want to get work done and not futz with it. That means I want everything statically linked, independent from each other, churn-free, and predictable.