Hacker News new | past | comments | ask | show | jobs | submit login

The stdlib is mostly fine. The string and character classification functions are outdated because they aren't Unicode aware. There's a more detailed write up here [1].

[1] https://nullprogram.com/blog/2023/02/11/




It's not just the missing UNICODE support (although that's probably out of scope for the stdlib, a couple of UTF-8 aware helper functions would be good enough), but footguns-in-waiting like strcpy(), strncpy(), strcat(), strncat(), ...

All the wide string stuff (wchar.h and wctype.h) as well as locale.h is all pointless today.

Everything related to filesystems and file IO is just the bare minimum that's acceptable for simple UNIX-style command line tools, but not really useful in modern applications (most notably, any support for non-blocking IO and memory-mapped-files are missing).

Arguably, complex.h doesn't even belong in the stdlib (I wonder why such an esoteric feature was even considered).

Better support for custom allocation strategies would be nice (e.g. each function which allocates under the hood should accept an allocator argument instead of being hardwired to malloc).

I'm not even asking for a more feature-rich stdlib, a stdlib2 with the obsolete parts removed and modernized IO and memory management functions would go pretty far. But then of course there's the problem that the C stdlib is also accidentially the de-facto system API on some UNIXes.


> any support for non-blocking IO and memory-mapped-files are missing

Sure but POSIX supports that and it may as well be the stdlib for those of us in *nix land.




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

Search: