3 ms·
I think it makes a lot of sense? A language has a surrounding set of commonly used and well adopted libraries for things that are common, but just not critical
by deathanatos 4y ago
I think it makes a lot of sense? A language has a surrounding set of commonly used and well adopted libraries for things that are common, but just not critical enough to get included within the standard library. E.g., having serde as a cornerstone for encoding/decoding means that, e.g., I can integrate with a decoder for complicated types easily, and I know how to do that independently of whether it's JSON, or TOML, or …. Having thiserror to help make rich error types.
C, admittedly, doesn't really have that. But I think that's mostly to C's detriment; projects have to sort of fill in those blanks themselves. Largely, I don't think they do: C libraries heavily prefer to return ints for errors, and I don't know that there are really "common" libraries out there? Certainly not to the same degree. (I wonder if the efforts didn't get focused onto higher level languages.)
Today, I'd mostly reach for C++ before C. Relatively¹ safer language, and the STL is far richer, and has basic data-structures that one requires for ordinary tasks. The situation is marginally better, e.g., there's boost, and the STL has seen some growth over time.
The downside, I'd say, is a single implementation and a looser spec, whereas C is standardized and runs on far more platforms.
¹and I mean relatively, as it is pretty trivial to utterly annihilate one's leg with C++