4 ms·
There was this idea of "Friendly C" which in part would have brought C semantics closer to the concrete computer semantics. But it fizzled out before it really
by zokier 4y ago
There was this idea of "Friendly C" which in part would have brought C semantics closer to the concrete computer semantics. But it fizzled out before it really even got started properly. Regehrs "post-mortem" post summarizes the problem: https://blog.regehr.org/archives/1287 https://blog.regehr.org/archives/1287
While there is a "group of C users who are unhappy with aggressively optimizing C compilers", they are not unhappy enough to put in the effort to define and implement alternative semantics.
- gpderetta 4y agoturns out DWIM is not a spec :)
- nullc 4y agoIt also turns out that the optimizations are valuable. It's easy to think its a bad deal when you are just complaining and don't actually have to face losing the optimizations.
- imtringued 4y agoIf there was an optimization flag for sanity then I doubt people would complain.
- zokier 4y agoThe way I see friendly c could have been more likely to be a perf win than loss; it's more replacement for -O0 (etc) and allow at least some optimizations on otherwise hopeless codebases.
- crabbone 4y agoUNIX as a whole, and C in particular weren't any kind of well-designed projects. They are awful inside and out. Their staying power isn't due to the goodness of the design or their remarkable performance. They are with us because of the network effect. Same as IPv4 + NAT, Base64-encoded email attachments etc. Plan 9 would be a similar attempt to this "Friendly C", or D language: these are attempts by people who were misguided to believe that the original technology was mostly good, and needed only a nudge in the right direction to fix a few problems here and there to make it perfect... but it turned out that the technology didn't succeed on technological merits, and improving the technology only so slightly isn't going to bring any new audience to the clone. C has way too many problems, far beyond undefined behavior. None of that is important as long as the most popular operating system on the planet is written in C, and C89 at that...
- AnimalMuppet 4y ago> UNIX as a whole, and C in particular weren't any kind of well-designed projects. They are awful inside and out. Their staying power isn't due to the goodness of the design or their remarkable performance. They are with us because of the network effect. Can you explain why Algol-68 and PL/I didn't generate any network effects? C may have survived for over 50 years because of network effects. But it didn't get in the position to have network effects by being "awful inside and out*. It got in the position to have network effects by being considerably better than the existing alternatives. (Better for actually writing programs, not better in any theoretical CS kind of way.)
- int_19h 4y agoI don't think it's fair to say that C was better by itself, as a language. It's more that it was better specifically in the niche of early microcomputers, in part because it has much less competition there. And then when that niche exploded - for other reasons - so did C. In many ways, I think this parallels the rise of JavaScript, which was far from the best language in general, but happened to be the best language that would run in any browser - and so as popularity of the web grew, so did JS.
- crabbone 4y agoC was better than Pascal? Or Fortan? Puh-leeease! Despite small community and not a lot of people working on Fortran compilers (at least as compared to C), Fortran programs usually still beat C on benchmarks. And Pascal? -- Well, it has so much better grammar... like, it was specifically designed to be unambiguous LL(1) language. And these are only the two I can name off the top of my head that would straight-up win against C in almost every respect, or at least draw. And these two predate C. If you look more closely at the history of UNIX and C, you realize that people who created it weren't guided by some great ambition to make a good product... they were just pricks who didn't like to study what others did before them, and thus invented their own square-wheel bicycle. They then also lacked the insight into how defective their bicycle was, but were really eager to sell it to those who knew even less about bicycles. It was through pure luck that UNIX took off and won the OS race. It has nothing to do with its engineering qualities.
- H4ZB7 4y agobecause they don't have any. C operates on headcannon