4 ms·
C isn't "just C", it's also stdlib and the assorted headers for platform code. This little distinction makes all the difference in terms of immediate utility,
by syntheweave 3y ago
C isn't "just C", it's also stdlib and the assorted headers for platform code.
This little distinction makes all the difference in terms of immediate utility, because in practical usage, languages tend to be libraries with the language attached, rather than the converse.
To be a serious replacement to C, Zig had to resolve this question about what a standard library should look like going forward, and across more exotic targets like WebAssembly. They made some thoughtful choices, more than I can summarize(especially since I haven't followed the project in a while).
When your language is "compile to C" you get stdlib for free...and you have to deal with cross-platform behavior in a C-like way forevermore. And this is a huge hindrance because it means your build system is now in the 1970's, and anything you accrete upon it eventually gets dragged back there because a user wants to get some Big Important Library compiling and nobody is on the same page about how to do that.
If you target LLVM you get compiler infrastructure, but also options about what you want the overall experience to look like, which can include C header compatibility, or something else. It's more feasible to achieve a thoughtful design like what Zig does.