3 ms·
> So you are well aware that isn't regular C that gets written, rather something that most HN readers would run away from if forced to write such kind of C. I'
by lelanthran 2y ago
> So you are well aware that isn't regular C that gets written, rather something that most HN readers would run away from if forced to write such kind of C.
I'm not sure what your point is.
It isn't always standard C, if that's what you're trying to say.
It's usually not a hosted implementation, but sometimes it is. It's usually done within industry regulated guidelines, but not always.
The fact is, the "not always" bit matters, because the body of C code controlling actions where human lives matter is so large that there is still a substantial body of standards-compliant C code that doesn't kill people!
The claim being made is contrary to the large body of evidence that we have.
- pjmlp 2y agoMy point is MISRA, AUTOSAR, DO-178C and plenty of other ones, alongside the industry moving on into hardware memory tagging as the only means to fix C for such kind of security critical systems, short of using something else if possible as suggested by upcoming cybersecurity laws.
- lelanthran 2y ago> My point is MISRA, AUTOSAR, DO-178C and plenty of other ones, alongside the industry moving on into hardware memory tagging as the only means to fix C for such kind of security critical systems, I dunno how relevant that is. The argument was "Irresponsible to use C for critical systems" The counterpoint is "Despite being the primary language for critical systems, negligible failures have been attributed to the language." I'm basically saying this: How do you explain both that severe reaction to using C AND the historically negligible failure rate of the language itself?
- RealityVoid 2y ago> How do you explain both that severe reaction to using C AND the historically negligible failure rate of the language itself? You CAN get from point A to point B by riding a horse, but why would you when cars are a faster alternative? But to the point, many failures have been attributed to the language, most of security bugs stem from the C's lack of memory safety. _Fortunately_ the reason not a whole lot of deaths can be attributed dirrectly to C is the fact that: - The safety critical sw is has multiple redundancies baked in, including at the HW level that would safeguard against fatal outcomes. - Safety critical SW is tested intensley. This proves the "common" cases of usage, but in my experience still fails for long-tail events. - Memory corruption issues would most of the cases "mearly" lead to resets instead of wrong program output. - Thinking about SW that is deployed in large numbers, if we admit that memory corruption issues happen in very special cases ( see 2nd pct) then the sudden appearence of a bug could _very_ easily be bundled as a fluke instead of a bug and we would probably not be able to distinguish the failure leading to death as being attributed to C. (since " it works fine on my machine" in 99.99% of the cases)
- pjmlp 2y agoVery easy, the only way C can be resposibly used in critical systems is to put so many guard rails and training wheels in place, that it no longer looks like C in first place. It is only negligible for those that don't have to fix CVE issues. Which is why we have all those ongoing security laws, companies and goverments have finally started to map money burned due to those CVE fixes.
- bdw5204 2y agoI'd say the main reason why there's a phobia of using C would be that it is a language that requires skilled programmers. C programmers are not interchangeable cogs which means corporations that are dependent upon C code have to hire the best programmers not the ones with the best "soft skills" or the ones with the "right" physical appearance. The one thing corporations wanted, above all, was to increase the supply of programmers who won't break everything. This explains the trends towards safety in programming languages and it also explains why OOP became so popular. It also explains the push over the last 10-15 years or so for everybody to learn to code. Anything that is hard reduces the number of potential programmers which is bad for business's bottom line.