News for hackers. Stuff that matters.
Re:Rob Pike: On Bloat by hulitu on Friday February 14, 2025 @04:14AM (#43046450)
> The key pattern is that it's always easier to build upon existing systems

Is it though ? I've seen a lot of programs using 1 or 2 functions from a library, but, nevertheless, linking the whole library.

Doing an ldd in /usr/bin is an exercise in horror.

Re:Rob Pike: On Bloat by lmm on Friday February 14, 2025 @04:30AM (#43046555)
> I've seen a lot of programs using 1 or 2 functions from a library, but, nevertheless, linking the whole library.

Exactly. Because it's easier.

Of course it would be much better to split that library up into smaller libraries so you only linked the part you actually needed, but then people on HN will go crazy about "thousands of dependencies".

Re:Rob Pike: On Bloat by zozbot234 on Friday February 14, 2025 @06:00AM (#43047152)
Why does this even matter? The system will only ever load code into RAM that's actually used by the final binary, because code is fetched as-needed from disk/mass storage.
Re:Rob Pike: On Bloat by lmm on Friday February 14, 2025 @06:44PM (#43054321)
That other code is still taking up address space and making the symbol table bigger (and therefore slower to use). And someone might want to use your program in a context where they don't have so much disk available. More importantly these giant libraries become hard to upgrade and therefore hard to make changes to.
Re:Rob Pike: On Bloat by zozbot234 on Friday February 14, 2025 @07:05PM (#43054455)
Address space is abundant enough on 64-bit platforms that we even waste a lot of it on security mitigations. Symbols tables are overhead, but loading multiple libs also involves all sorts of overhead. The disk space argument makes the most sense, but binary code doesn't take up a lot of disk space these days; a vast majority is typically used for data, media, the latest large AI model etc.

Having larger shared libraries also means you no longer have to statically link that included code into multiple separate executables.

Re:Rob Pike: On Bloat by RGBCube on Friday February 14, 2025 @09:24AM (#43048595)
Have the great people of Hacker News never heard of LTO?
Re:Rob Pike: On Bloat by eterm on Friday February 14, 2025 @05:04AM (#43046794)
> using 1 or 2 functions from a library, but, nevertheless, linking the whole library

This feels like something a compiler could or should solve.

Re:Rob Pike: On Bloat by criddell on Friday February 14, 2025 @08:07AM (#43047927)
Compilers and linkers do solve this for some languages.

I use C++ and make use of the excellent Boost library. The library is gigantic, but only the parts I use make it into my binary.

Re:Rob Pike: On Bloat by test1235 on Friday February 14, 2025 @07:03AM (#43047515)
Re:Rob Pike: On Bloat by BenjiWiebe on Saturday February 15, 2025 @10:15PM (#43064979)
Dynamic linking - it's fine. Most of those libraries are already in memory anyways when you run the program.