All software sucks (2007) (opens external site)
View full thread · View on Hacker News
To get push notifications on iPhone or iPad, add Hack and Chat to your Home Screen: tap Share → Add to Home Screen, then open the installed app and enable push in Settings.
View full thread · View on Hacker News
- Size: shared libraries save some disk space. But disks are absurdly large these days compared to executable code, and in practice, code is never the thing that's going to fill up your disk. Your disk is going to be full of data, not code. (Or whichever hybrid of "code" and "data" you want to call a set of neural network weights...)
- Memory: shared libraries can theoretically have the same mapped code pages in memory across several processes. Marginally more interesting, but still not where most of your RAM is going today.
- Upgrades, maintenance, and build time: the expectation that if there's a bug in the shared library, you can update the shared library, and not need to update all the software built atop it. The most interesting reason that's still remaining, but not enough to put up with the tradeoffs of dynamic linking. You'd still have to restart all the applications that have that shared library loaded, so you don't get any logistical isolation there (whereas you would with components communicating via some RPC protocol). You may well have to rebuild things anyway, if the bug is in anything that gets inlined into the application. You have versioning problems, and all the clever schemes like symbol versioning are used by vanishingly few libraries (mostly glibc). And ultimately, rebuilding software isn't nearly as expensive as it used to be, because we have a lot more computing power now.
Dynamic linking seems like a tradeoff designed when the most interesting shared library on your system was libc. It imposes logistical and efficiency costs on everything. And it doesn't buy enough to be worth it.
If you want to have shared components that can be upgraded independently, have services communicating via RPC.
Replies (2)
As you said, logistical and efficiency costs.
Replies (1)
The most annoying tradeoff with that is you can't pass libc pointers across DLL boundaries. You can't malloc something in one DLL and free it in another. You either use an allocator from a known DLL (like LocalAlloc/LocalFree) or you give your DLL a wrapper call to free so you can free the things it returns.
Replies (1)
You shared a great example. A unified program loader allows multiple libc implementations. However, no single unified libc means no passing libc pointers across DLLs.
Everyone hates dynamic linking, but it's necessary. Modern versions like Apple's dyld shared cache avoid a lot of the problems (at the cost of centralization).