3 ms·
The basic principle of radiation-hardened programs is to have as many safety nets as possible. The particular example in Wikipedia does this by, at the topmost
by lifthrasiir 2y ago
The basic principle of radiation-hardened programs is to have as many safety nets as possible. The particular example in Wikipedia does this by, at the topmost layer for example, having two same string literals and `eval`-ing the longer literal (which would then use that literal to complete the quine). Since this `eval` call can be disrupted instead, it first checks whether two literals are same and calls a dedicated code path:
/#{eval eval if eval==instance_eval}}/.i rescue##/
This code path is carefully designed so that it always remains a valid Ruby code in any case and will execute the following line only when `eval` was not called. This kind of principle drives the entire source code.
> also for "bit flips" i.e. a changed character?
No. You can trivially make it invalid by changing the first character (`e`) to, say, `%` or 0xE5. It will be generally impossible to make such program for many languages with fixed classes of code characters.
- rkagerer 2y agoThanks! I also found this article[1] helpful, particularly the section describing what happens if parts of the Outside Wrapper get deleted. [1] https://codegolf.stackexchange.com/a/100785 https://codegolf.stackexchange.com/a/100785