4 ms·
Much of libc is terrible from an API design perspective, even given the limitations of C as a language. libc has somehow managed to hit the sweet spot and have
by nly 8y ago
Much of libc is terrible from an API design perspective, even given the limitations of C as a language.
libc has somehow managed to hit the sweet spot and have APIs that are both inconvenient to use properly, and perform poorly.
- agumonkey 8y agoany attempt has been made to build a nicer foundational C/OS library since ?
- nly 8y agoBSD has some minor improvements to libc. There's also glib. Generally though, C is just a terrible language to do anything other than write extremely low level routines in. You should probably just never use strtok() and go straight to something like Ragel or re2c for building high performance tokenizers... then call those from a higher level language.
- yakovdk 8y agoHey! I take exception to that. I've been writing shellcode all week. C is uncomfortably high level for writing low level routines!
- jstimpfle 8y agoThere are of course tons of code on the net, but there is no need to standardize another grab-bag of bad API calls. If you need a batteries-included library you use python or similar. If you write in C, you care so much that you largely avoid the standard library and design your code from the ground up.
- dkrikun 8y agoThere are numerous reasons to write in C, apart from caring so much. Using strtok() is not that bad after all because its a simple function after all.
- Matthias247 8y agoYou should. However there are lots of organizations around that use C because that’s what’s used in their domain (E.g. embedded) AND use the standard library, because they don’t know how to do better. The results are often worse than if they would have used a higher level language right from the start.
- nwmcsween 8y agolibc aka ISO, POSIX, GNU wasn't designed it was more or less evolved from what was in use.