by pornel · 5y ago · 0 comments
• C is valued for being super portable and compatible with every platform, including legacy ones, but this applies to specifically C89 or C90, and nothing else. As soon as you embrace new features, it's not your universal C any more. You're going to need newer compilers, new tooling, and that's almost like starting with a new language.
• C users have mostly self-selected themselves to like C the way it is: a small, flexible, zero-overhead language that isn't C++. Addition of checked containers, generics, and restrictions on pointer arithmetic, etc. make checked C not feel like C any more.
• Checked C still needs refactoring of the code. For large established codebases this is still a lot of work, and still a risk of introducing new bugs. It's very tempting to settle on just running one more analyzer, sanitizer or fuzzer instead.
And in the end with all this effort, back-compat break, whole-codebase refactoring you're still left with the old C, with headers and include paths, sloppy macros, ancient stdlib, painful dependency management, etc.
If you're going to rewrite C incrementally to a more complex dialect, and require a newer non-standard compiler for it, you may as well run c2rust on it first.
Many of the people that keep using C as is, will never use something else no matter what.
One reference implementation is a lock-in, not only technologically, but also socially in terms of a community that is too monolithic for its own good.
Let's not forget that C is ~50 years old and yet having reliable, open-source, high-quality compilers is a thing of the past 20 years or so. Clang was born in the 2000's, GCC is much older but it wasn't that great of a compiler for some time. Same with VS.
That's not true for all those examples: both Ruby and Python have several great implementations and Go started with specification and two implementations.
It might be a lock-in but fragmentation is bad too.
And indeed, it's probably not suitable for refactoring, but if you want to start a driver from scratch?
I do not see what would make C more flexible than any other language. The other points are correct and C's niche is indeed that it is small, ubiquitous, simple, and yet low level.
An unsuccessful attempt at embrace, extend, extinguish.
If they just needed type checking, it could've been done with either tests, or annotation for checks at compile time, but instead they've developed a whole new language that gets more, and more diverged from the original one with each release.
Also "TypeScript thing" is definitely downplaying where TS is as a language https://2020.stateofjs.com/en-US/technologies/javascript-fla...