5 ms·
Excuse the noob question, but why are there different libc implementations at all? I mean, their featureset is defined by standard, so all implementations shoul
by mschuster91 11y ago
Excuse the noob question, but why are there different libc implementations at all? I mean, their featureset is defined by standard, so all implementations should strive for the maximum performance - so where comes the bloat from?
Support for multiple archs is of course a valid source for percieved bloat, but that should matter only at compile time?
- wtallis 11y agoI think you'd be surprised at how much variation there is in the feature set. libc isn't just the C standard library as defined by the language standard. It's the OS standard library too, and includes POSIX stuff and some de facto standard stuff and some OS-specific stuff. The musl author has a comparison table: http://www.etalabs.net/compare_libcs.html http://www.etalabs.net/compare_libcs.html Historically, the biggest reasons for alternate libcs have been to make tradeoffs for use on embedded systems (uClibc) or political/license differences.
- kryptiskt 11y ago> Historically, the biggest reasons for alternate libcs have been to make tradeoffs for use on embedded systems (uClibc) or political/license differences. And also the toxic maintainership of glibc in the Drepper era.
- deleted 11y ago[deleted]
- vezzy-fnord 11y agoHere's an article from the musl wiki that explains differences from glibc: http://wiki.musl-libc.org/wiki/Functional_differences_from_glibc http://wiki.musl-libc.org/wiki/Functional_differences_from_g... All the bugs discovered by musl, and how many are glibc-related: http://wiki.musl-libc.org/wiki/Bugs_found_by_musl http://wiki.musl-libc.org/wiki/Bugs_found_by_musl If you want to know why someone would want to replace glibc, then I give you a challenge: figure out how glibc implements printf(3). Good luck. The answer is: http://blog.hostilefork.com/where-printf-rubber-meets-road/ http://blog.hostilefork.com/where-printf-rubber-meets-road/
- nickpsecurity 11y agoOmg that was a great article on printf. I had more Wtf's than I've had in a while despite how many times I've called out C and UNIX implementations for their complexity. Here's another good one in return: http://queue.acm.org/detail.cfm?id=2349257 http://queue.acm.org/detail.cfm?id=2349257 Makes me wish systems like Oberon got famous instead lol...
- vezzy-fnord 11y agoThere's still hope for Unix, if DragonFly BSD is any measure. A shame no one feels the need to follow its lead. And yes, that PHK op ed is well known. It's been posted here before, though if I have to be honest PHK messes up his nomenclature, even if his points are mostly correct. No Oberon, but maybe we can at least get some good capabilities like EROS if the work on Capsicum goes through.
- nickpsecurity 11y agoI'll have to update myself on DragonFly in near future. Good that you know about EROS and Capsicum: ahead of most ;). Check out CheriBSD on CHERI processor if you like that. Far as software, JX Operating System and GenodeOS are two clean-slate one's with architectures you might find interesting. Interesting in terms of foundations to build better stuff on.
- vezzy-fnord 11y agoOh yeah, there was a talk about CheriBSD at this year's BSDcan. Gotta look more into it. GenodeOS looks fascinating from first glance. I'm aware of the various JVM-based OSes, but I have no personal interest in them. Thanks anyway.
- nickpsecurity 11y agoJust looked up DragonFly BSD. Prior I just heard it was doing concurrency or something differently. Looking at the details... damn, I'm impressed. It's still a UNIX architecture with the good and bad that comes from that. Yet, they're applying rather than ignoring many good engineering choices for dealing with various UNIX problems such as concurrency, integration, OS-level faults, & kernel debugging. The HAMMER filesystem is also a nice development given it's not GPL or Oracle-related (right?). A BSD alternative to ZFS is by itself worth a whole project. So yeah, there's still hope for UNIX. Looks like that hope goes two ways: 1. UNIX variants like DragonFly that intentionally break things or get rid of crud to better themselves over time. 2. People on such projects who stumble onto superior architectures while looking for improvements and start building a better non-UNIX. I'll keep checking up on it to see what happens.
- laichzeit0 11y agoOne use case is embedded systems. The code space available can vary from a few kilobytes to a few mbs as well as memory overhead. Sometimes you won't even pull an entire library with even though it's small, you'll statically link in only the functions you used.