Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

glibc is a project with a 30 year history of legacy code, and they made it portable between different UNIX kernels (it predates Linux).

It has maintained strict ABI compatibility since glibc 2.0, released in 1996; a lot of functions have multiple different implementations with versioned symbols, just so existing binaries built against older versions continue to run.

Naturally all of this compatibility gunk does not lend itself to simple and maintainable code; perhaps call all of that accidental complexity "the tax of the UNIX philosophy".



People on other sites I shared it on said the glibc was worse than many they worked with. They're from back in the day, too. So, for now I'll call it the tax of the GNU UNIX philosophy.

The BASIC, Pascal, Modula-2, and Ada code looked much less hacked together even when it was portable or old. Still looked weird & dated but more readable. So, like one commenter said, it's also because of C. It's design and culture lead people on the path of much dirty hackery to... implement a printf statement.

Note: Situations like this argue for real macros and metaprogramming like in LISP. A pseudo code of what each aspect does plus its implementation would make it more comprehensible.


they made it portable between different UNIX kernels (it predates Linux).

In practice, the only platforms that really use it are GNU/Linux and GNU/Hurd. Even Android uses Bionic libc. Though I guess there's also novelty projects like GNU/kFreeBSD.

perhaps call all of that accidental complexity "the tax of the UNIX philosophy".

I don't know why anyone would call it that.


IIRC it was initially developed for some version of SunOS.

Edit: here's the list of supported platforms, from the 1.09 tarball:

		alpha-dec-osf1
		i386-bsd4.3
		i386-force_cpu386-none
		i386-gnu (for Hurd development only)
		i386-isc2.2
		i386-isc3
		i386-sco3.2
		i386-sco3.2v4
		i386-sequent-bsd
		i386-sysv
		i386-sysv4
		i960-nindy960-none
		m68k-hp-bsd4.3
		m68k-mvme135-none
		m68k-mvme136-none
		m68k-sony-newsos3
		m68k-sony-newsos4
		m68k-sun-sunos4
		mips-dec-ultrix4
		mips-sgi-irix4
		sparc-sun-solaris2
		sparc-sun-sunos4
> I don't know why anyone would call it that.

It was a tongue in cheek remark, given how projects that don't want to pay that tax get accused of being in violation of said philosophy :-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: