TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Radiation-hardened Quine (2014)

360 pointsby sirnicolazabout 2 years ago

28 comments

purkkaabout 2 years ago
This comes from the same dev known for the 128-language quine relay, where each of the 128 languages prints a program in the next one, looping all the way to the original one. In alphabetical order and as ASCII art, no less.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;mame&#x2F;quine-relay">https:&#x2F;&#x2F;github.com&#x2F;mame&#x2F;quine-relay</a>
评论 #36164874 未加载
评论 #36163159 未加载
评论 #36162636 未加载
评论 #36163319 未加载
评论 #36163932 未加载
评论 #36170938 未加载
tomxorabout 2 years ago
&gt; Prepare a script that deletes one character randomly:<p>Hmm, but can it also deal with general bit flips? Because that&#x27;s usually what radiation does not delete characters. The only case it would delete a character with a bit flip on the data would be causing the DEL char 0x7F i think, which 7 ASCII chars have a 1 in 8 chance of mutating into (because we have 8 actual bits but only 7 are used for ASCII): ~}{wo_?<p>There are 96 ASCII characters that might be used in source code naively assuming equal character probability that&#x27;s 7&#x2F;96 * 1&#x2F;8 = 0.9% chance of a bit flip deleting a character by mutating into 0x7F. There&#x27;s also a chance of a character mutating into a non-printable character (0-31), only the 2nd and 3rd column of ASCII can mutate into this by ending up with both high bits off, so there are 64&#x2F;96 chars with a 1&#x2F;8 chance that&#x27;s an 8.3% chance of mutating into a non-printable control char etc (i&#x27;m ignoring LF because it displaces DEL). If the 8th bit flips into a one on any char then we get extended ASCII I <i>think</i>, that&#x27;s 96&#x2F;96 * 1&#x2F;8 = 12.5% chance. That leaves 78.3% chance of mutating into another regular printable ASCII character. Apologies for any bad math.<p>There are a lot of possible affects on the interpreter when it sees any of those characters, the control chars could be particularly troublesome.<p>Either way this is still a very cool quine :P
评论 #36165760 未加载
评论 #36168295 未加载
评论 #36166001 未加载
NickHoffabout 2 years ago
See also the International Obfuscated C Code Contest. [0]<p>This program [1], for example. It just accepts some input on stdin and returns the same input, but mirrored along the diagonal. So the first row of the input becomes the first column of the output, second row becomes second column, etc. But the program is functionally invariant when given itself as input. In other words, you can flip the source code of the program along its diagonal and the result is a program which has the same functionality - it flips stdin.<p>Or this one [2], which parodies java in C. It&#x27;s functional C code that looks like Java, including the<p><pre><code> class LameJavaApp { &#x2F;** The infamous Long-Winded Signature From Hell. *&#x2F; public static void main(String[] args) ... </code></pre> Or this one [3] that calculates pi by estimating its own surface area.<p>Or this one [4]. It&#x27;s a lovers quarrel, written simultaneously in C and English. It&#x27;s incredible, seriously, read it.<p>[0]: <a href="https:&#x2F;&#x2F;www.ioccc.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.ioccc.org&#x2F;</a><p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;ioccc-src&#x2F;winner&#x2F;blob&#x2F;master&#x2F;1994&#x2F;schnitzi.c">https:&#x2F;&#x2F;github.com&#x2F;ioccc-src&#x2F;winner&#x2F;blob&#x2F;master&#x2F;1994&#x2F;schnitz...</a><p>[2]: <a href="https:&#x2F;&#x2F;github.com&#x2F;ioccc-src&#x2F;winner&#x2F;blob&#x2F;master&#x2F;2005&#x2F;chia&#x2F;chia.c">https:&#x2F;&#x2F;github.com&#x2F;ioccc-src&#x2F;winner&#x2F;blob&#x2F;master&#x2F;2005&#x2F;chia&#x2F;ch...</a><p>[3]: <a href="https:&#x2F;&#x2F;github.com&#x2F;ioccc-src&#x2F;winner&#x2F;blob&#x2F;master&#x2F;1988&#x2F;westley.c">https:&#x2F;&#x2F;github.com&#x2F;ioccc-src&#x2F;winner&#x2F;blob&#x2F;master&#x2F;1988&#x2F;westley...</a><p>[4]: <a href="https:&#x2F;&#x2F;github.com&#x2F;ioccc-src&#x2F;winner&#x2F;blob&#x2F;master&#x2F;1990&#x2F;westley.c">https:&#x2F;&#x2F;github.com&#x2F;ioccc-src&#x2F;winner&#x2F;blob&#x2F;master&#x2F;1990&#x2F;westley...</a>
评论 #36162869 未加载
评论 #36162717 未加载
xigoiabout 2 years ago
Someone managed to create a level 3 radiation-hardened quine in Perl (you can remove any 3 characters and it still works):<p><a href="https:&#x2F;&#x2F;codegolf.stackexchange.com&#x2F;a&#x2F;100785&#x2F;98955" rel="nofollow">https:&#x2F;&#x2F;codegolf.stackexchange.com&#x2F;a&#x2F;100785&#x2F;98955</a>
评论 #36163104 未加载
GistNoesisabout 2 years ago
Here is something quite similar I&#x27;ve just made, but in the image domain :<p><a href="https:&#x2F;&#x2F;github.com&#x2F;unrealwill&#x2F;uncroppable">https:&#x2F;&#x2F;github.com&#x2F;unrealwill&#x2F;uncroppable</a><p>It&#x27;s a tool POC to steganographically encode an image into itself to make it crop resistant.
asimpletuneabout 2 years ago
Is DNA a radiation hardened quine? I mean, it’s basically code that makes more of itself, even in the presence of mutations.
评论 #36163653 未加载
评论 #36163069 未加载
评论 #36163162 未加载
评论 #36163447 未加载
评论 #36163067 未加载
评论 #36167713 未加载
CrampusDestrusabout 2 years ago
Wait, what is the definition of radiation hardening? Radiation would flip one random bit at a time, not delete a whole character in one go.
评论 #36164789 未加载
sarabandeabout 2 years ago
FYI: A quine is a computer program which takes no input and produces a copy of its own source code as its only output.
cnityabout 2 years ago
Challenge: a self-healing version of this where the program missing a character outputs the original program (with the character re-inserted).
评论 #36162660 未加载
评论 #36163080 未加载
评论 #36162666 未加载
defaultcompanyabout 2 years ago
The author of this quine (Yusuke Endoh) has a Github repository which encodes a program in the Github contributions graph. I have no idea what the program does but here is a link to the start of it:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;mame?tab=overview&amp;from=1970-12-01&amp;to=1970-12-31">https:&#x2F;&#x2F;github.com&#x2F;mame?tab=overview&amp;from=1970-12-01&amp;to=1970...</a>
评论 #36171607 未加载
lordnachoabout 2 years ago
How... does it work? What happens if you delete one of the characters in &quot;eval&quot;? What&#x27;s the space in &quot;e xit&quot; about?
评论 #36163059 未加载
shultaysabout 2 years ago
Radiation would flip a bit though, which more likely changes a character
评论 #36163891 未加载
评论 #36175233 未加载
fouronnes3about 2 years ago
This is absolutely incredible. Definitely one of those &#x27;I will never understand how&quot; black magic levels of impressive.
评论 #36162991 未加载
nkitabout 2 years ago
IIRC I saw an interpreter somewhere where each input program is quine, the interpreter name rhymed with `hat` as I remember it.
eimrineabout 2 years ago
Any known issues when radiation deleted (instead of altering) any characters? Deleting something is introducing significantly more entropy than altering because it alters the length of the array of text, but altering the array requires recalculating of the rest of the array which is impossible outcome of radiation.
jerjerjerabout 2 years ago
Mostly impressed that it&#x27;s not two redundant copies of a source code, but rather one actual code fragment.
评论 #36164297 未加载
评论 #36162674 未加载
dangabout 2 years ago
Related:<p><i>Radiation-hardened quine (2014)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18840797" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18840797</a> - Jan 2019 (22 comments)<p><i>Radiation-hardened Quine is now “ascii-arted”</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8318879" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8318879</a> - Sept 2014 (1 comment)<p><i>Radiation-hardened quine</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7276976" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7276976</a> - Feb 2014 (71 comments)
belterabout 2 years ago
Radiation-hardened quine (4 years ago) - 22 comments - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18840797" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18840797</a><p>Radiation-hardened quine (9 years ago) - 71 comments - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7276976" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=7276976</a>
estabout 2 years ago
holy .... even more impressive, it was created 9 years ago!
评论 #36163225 未加载
danparsonsonabout 2 years ago
If this isn&#x27;t definitive proof that we live in a simulation, I don&#x27;t know what is.<p>Seriously impressive work!
willis936about 2 years ago
What are the advantages to radiation hardening software? In the cases I&#x27;ve run into the thinking has been &quot;if you can&#x27;t trust the hardware then you&#x27;re already lost&quot;.
评论 #36166349 未加载
评论 #36163666 未加载
评论 #36163674 未加载
评论 #36175260 未加载
mabboabout 2 years ago
Now can we go further and add self-healing?<p>Include a checksum somewhere. Modify the output or the checksum until they agree.<p>This is starting to sound like how the immune system works actually...
评论 #36163788 未加载
kiiciaabout 2 years ago
How is radiation supposed to delete character instead of flipping one bit? How is interpreter protected?
saint-loupabout 2 years ago
No matter how many times you kill him, Quine rises from his tomb, his hand showing through the dirt to point at a rabbit.
Alifatiskabout 2 years ago
I follow mame, always up to something fascinating!
jherikoabout 2 years ago
does it work if you flip any random bit though?<p>no.
TheGoddessInariabout 2 years ago
(2014)
评论 #36163341 未加载
tus666about 2 years ago
Eh its not a quine anymore.
评论 #36163800 未加载