3 ms·
I am mostly in the other side of this argument. C is an insane language in my view ( in a modern context ). That said, what “mission critical software” are you
by LeFantome 2y ago
I am mostly in the other side of this argument. C is an insane language in my view ( in a modern context ).
That said, what “mission critical software” are you using that is not running on an OS written in C?
- eru 2y ago> > No one in their right mind would write mission-critical software in C. > That said, what “mission critical software” are you using that is not running on an OS written in C? I'm not sure that's relevant? If you have a piece of mission critical software, almost all the time you run it on an existing OS like Windows or Linux. You don't _write_ a new OS just for your one piece of software. Of course, that OS had to be written at some point in the past (and is still being worked on). Presumably that writing was (and is) being done by people not 'in their right mind'. But that shouldn't concern you. The problem with C is not that you can't write secure-ish software at all; the problem is that this is insanely difficult, and that the trade-offs aren't worth it. Especially for new software. For software that I get from some third-party, like the OS, I only care about its quality (and price); I don't care about the trade-offs and pains the authors had to endure. If they want to use C in the privacy of their own bedroom, that's up to them. Of course, Linux in 2024 is written in C, mostly because Linux in 2023 was written in C, then 2022, etc all the way back to the 1990s. There's a lot of path dependence. Back in the 1990s C was a more reasonable choice to write your new OS in. Especially if it was a clone of Unix, C's original home and killer app.
- airbreather 2y ago0Yeah, so I am a functional safety engineer, but for industrial process plant and machinery. We don't use C, traditionally it is safety controllers, specialised PLCs. Most safety PLC's boot into a hypervisor that boots an OS (Wind River Linux or something) that runs a program that might be your complied config, or runs a program that runs your configuration (eg code you wrote). So what languages does it seem likely were used for all those extra layers between your code and the CPU? And I am talking the sort of controllers that supervise LNG plants, large buildings where they might have more than one elevator in any shaft, prevent overpressuring pipelines and creating environmental disasters and so on. I would be more comfortable personally if I could write a c program and compile it knowing that the compiled code will run on the bare metal, at least then there are not a couple of closed source proprietary layers of abstraction between me and the processor. Note : in case you wonder what the difference between a regular PLC and a safety PLC is, a safety PLC has a fuckload more diagnostics. For a safety system PLC, faults aren't the problem, it is dangerous undetected faults. A detected dangerous fault will trip to a shutdown immediately and is an availability issue, not a safety issue. But, guess what language the firmware that does these diagnostics is written in? I don't know, but I doubt strongly it is one of the 5 PLC languages specified in IEC 61131, so that leaves it likely to be C.
- pjmlp 2y agoHistorical reasons, my Windows, Android, macOS, iOS devices have plenty of OS code written in C++. Even those criticial OSes that refuse to move beyond C, most likely are using C compilers written in C++.