News for hackers. Stuff that matters.
Re:Nature’s libraries are the fountains of biological innova... by mdda on Saturday September 24, 2016 @01:46PM (#12571815)
But also imagine that the algorithms you write had to work (perhaps slightly differently, but essentially the same) when hit with bit-flips in the code. How would one do that? Perhaps have multiple copies, or coding redundancy, or fix-up routines, or fall-back instructions. All the kind of stuff that mother nature already figured out. But that should be unsurprising, since without that robustness, the evolution thing would kill our progeny almost every time. Building the robustness is almost as important as building the functionality.
Re:Nature’s libraries are the fountains of biological innova... by j-g-faustus on Saturday September 24, 2016 @06:10PM (#12572861)
> imagine that the algorithms you write had to work (perhaps slightly differently, but essentially the same) when hit with bit-flips in the code. How would one do that?

Gray code [1] does it for integers: Any two consecutive values are one bit-flip apart.

Instructions could perhaps be encoded similarly: Say an n-bit gray code represents an instruction. Each instruction has an n-bit ID, IDs are spread evenly over the space of n-bit values, and each instruction code resolves to the ID with the smallest Hamming distance [2].

Then most bitflips would yield essentially the same program, as long as the number of instructions is small compared to the number of n-bit values.

Our CPUs wouldn't run that directly, but I think it should be possible to construct simple bytecode instruction sets where practically any permutation of bits gives a syntactically valid program, and where bit sequences with a small Hamming distance in most cases resolve to similar programs.

[1] https://en.wikipedia.org/wiki/Gray_code [2] https://en.wikipedia.org/wiki/Hamming_distance

Re:Nature’s libraries are the fountains of biological innova... by smallnamespace on Saturday September 24, 2016 @02:00PM (#12571860)
One could also view unit tests and static type checking as making a program more robust to incorrect programmer-directed changes.
Re:Nature’s libraries are the fountains of biological innova... by mdda on Saturday September 24, 2016 @02:18PM (#12571928)
You'd also need to robustify the compiler itself to bit-wise errors, and its output.
Re:Nature’s libraries are the fountains of biological innova... by posterboy on Saturday September 24, 2016 @03:00PM (#12572082)
> to robustify

Did you mean to reinforce?