One simple example is the zero-bit. I don't have time to look up the exact details now, but IIRC, it's a simple hardware bit-flag that is part of the metadata of any value that can be read. If set, reading out that value returns zero. If not, it returns the actual value.
Data defaults to having the zero-bit set, and the only way to unset a zero bit is writing new data into whatever you want to read from. The exact mechanism is probably a bit different, but that's how I remember it.
Regardless of what the precise implementation is, the point is that by adding some smart hardware-based metadata like this in the form of bit-wise flags, you don't have to worry about having to manually wipe the data in memory once you are done with it (and have the speed benefits of not having to do so as well), yet still get all the safety benefits of never having to worry about buffer overflows and whatnot again.
It's happened, again and again. The ARM CPUs powering your phones are a good example. Maybe with more of a market, POWER9 prices might come down.
They are saner but the problem is still here
In truth you're correct, and ARM is sort of an unruly mess at this point, but that's a much larger discussion.
[0] https://twitter.com/RaptorCompSys/status/949368929507520517
I know nothing about low level programming, and I'm wondering if webassembly couldn't be a good place to start designing CPU instruction sets?
Can someone more competent on the matter tell me if this idea is crazy?
Yes, it's crazy. :)
But seriously, the ISA (instruction set architecture) is not the problem, but the optimizations (deep pipelines and speculative execution, etc.) are.
incredible how I (we) ran on buggy hardware for so long.
We should fund a tiny group for sane cpu design.