Hacker News new | ask | show | jobs
by tomatotomato37 2747 days ago
I think with C in particular it's counterbalanced by it's extreme compile times forcing devs to be picky with their libraries.

Another factor that probably helps is that most operating systems are built off C derivatives and thus usually are already carrying common libararies as dlls

4 comments

It's not the compile times that keep C codebases slim, it's the primitive build system. There's no notion of modules, so every project has to cobble together an equivalent thing, generally relying on make, autotools and its successors, and the result is both incompatible across projects and incompatible across slightly different build environments.

It's a failing of the Unix model with a small silver lining in that C projects tend to go out of their way not to have to make the build any harder than it already is.

> C in particular [...] it's extreme compile times

How so?

Simple really, the more static libraries you add, the longer it takes. This is most pronounced in the libraries themselves that usually don't risk the performance hit of using dlls, so you get less dependency-of-dependency.
Compile times are not extreme for C, only for C++.
SQLite, which is a single 6MB .c file compiles in under a second in any compiler and under 0.01 seconds with tcc.