Re:Some Were Meant For C (2017) [pdf]
by GeorgeTirebiter on Monday March 01, 2021 @09:47PM
(#26311361)
I am astonished that HARDWARE does not help us much. When 'everybody' decided going like a bat-out-of-hell was more important that security and safety and easy-to-not-screw-up languages w/garbage collection and capabilities and hw-enforced typing and and ... we end up where we are: a mess that runs fast. And, specifically, I think that RISC-V rather missed the boat here, by not taking the security/safety banner and leading to a new way of building computer systems. Instead, we got a different (open) ARMish thing. Progress...
People - or rather C compiler writers - don't even use the minimal safety capabilities that today's hardware has. Trapping NaNs? C is going to turn them off. Trap on null pointer dereference? The C compiler is going to optimize that away. Etc.
There are now efforts to turn computers into C Machines with hardware memory tagging.
While Intel's MPX extensions were a failure, Solaris makes use of ADI on SPARC, iOS uses PAC, Google is researching adopting ARM MTE into Android, ARM sponsors CHERI with Morello project, Azure Sphere has Plutonium, and so forth.
However these are all pontual efforts, and their large scale effects will take years or decades to start making a difference.
Can you actually have a faster system with hardware checks compared to what we can do with x86 with all security checks in software? If not, I don't see the point. Noone is going to buy slower hardware that runs the same safe language(which we already have access to).
"Many years later we asked our customers whether they wished us to provide an option to switch off these checks in the interests of efficiency on production runs. Unanimously, they urged us not to--they already knew how frequently subscript errors occur on production runs where failure to detect them could be disastrous. I note with fear and horror that even in 1980, language designers and users have not learned this lesson. In any respectable branch of engineering, failure to observe such elementary precautions would have long been against the law."