Generic quicksort library that can be used to sort an array having any data type (int, char *, struct key_value *, etc.).

Zack Weinberg zack@owlfolio.org
Fri Sep 26 19:12:29 GMT 2025


On Fri, Sep 26, 2025, at 8:41 AM, Amit wrote:
> I still think that it is not too late to incorporate [a new thing] in
> the C library (standard or extra).

I wish to explicitly disagree with this premise.

The only remaining virtue of C, in my not-so-humble opinion -- the
*sole* reason why I might still recommend its use in new code -- is its
great stability.  You can write C code today, with relatively little
effort, that will work just as well with compilers and libraries over a
decade old, as it does with new ones.  That is much harder with any
other language.

To preserve that property into the future, we need to *actively avoid*
adding new things to the C library, *even if* it would make it easier to
write new code in C -- because "a language that's easy to write new code
in" is no longer the purpose of C.  C is for when you are willing to
*sacrifice* a great deal of ease of use for the sake of being able to
compile and run your program in the maximum number of environments,
including old environments that don't have and *won't* ever have
shiny new features.

(To illustrate how strongly I feel about this, I think almost all of the
changes in C2023 shouldn't have been made.)

(There *are* still things I think we should add to glibc, like a
*complete* set of system call wrappers for Linux, but they're motivated
by more than just "this would make it easier to write new code".)

zw


More information about the Libc-alpha mailing list