Impressed By Slow Code
prog21.dadgum.com
prog21.dadgum.com
Why the C standard library does not get improved with a few data types like linked lists, hash tables, dynamic strings, and so forth is something I can't understand (one common reason why poorly written C code ends slower than equivalent code wrote in a scripting language is because of strlen() and other stupid string operations into a loop ending into exponential time complexity).
That said, BSD sys/tree.h (self-balancing trees) and sys/queue.h (linked lists of all kinds) give you a lot of functionality and can easily be made part of your project (be warned, though: glibc has a very incomplete implementation, so make sure to use the BSD version.)
On Unix systems with Gnome, there's GLib. It's very well-featured, very portable and available as prebuilt DLLs for Windows, at least.
On Mac OS X and iOS, there's CoreFoundation. My humble opinion is that it's the best OO-style C library. I'd love to use it on Windows, but unfortunately Apple wavered on their original commitment of open-sourcing CoreFoundation. They stopped releasing the source, and getting CF to build became very complicated at some point. I've lost track of what's the current situation, but clearly this makes it very difficult to rely on CF for cross-platform applications.
Yeah, there is nothing in c that makes it significant faster per se than python, remember python is pre-compiled.
C gives you control, it is "portable assembler" if you are used to assembler it is trivial to know exactly what the CPU does, if you can take advantage of it it will be faster, if you can't it wont.
With control you can make something run 100-1000 times faster because you know what the computer does, with a high level language you can not control it, period, it is abstracted.
That is the use of C or specific hardware(100-1000 less power usage).
Low level optimizations for a 10% speed up?. IMHO, Non sense.
If you mean "You typically get far more than a 10% return on low-level optimization investment," I agree. It's typically a dramatic improvement.
Could you give an example of python that's faster than C? Genuinely curious; I'd love to see one. (EDIT: wait I'm a noob, the article said that, not you. Sorry.)