Interesting article. I'd never heard of this concept before and thought "That sounds trivial" until I started to read the article. I must admit though, I gave up halfway through when the C code got too esoteric for me to follow. But still feel I've learned something new today.
The article title seems a bit off though. When I read 'Self-Replicating Programs' [sic] it I immediately thought "Worms" but the article actually refers to programmes which can print out their own source code listing. Which seems to me to be a different challenge.
> When I read 'Self-Replicating Programs' [sic] it I immediately thought "Worms"
You are not wrong at all. At its base, any virus is a quine. Well, both computer viruses and biological viruses are quines. Life itself would not be possible without quines.
An interesting "application" are zip quines, where a compressed archive decompresses to itself. https://research.swtch.com/zip
I recently built a zip quine that was simultaneously a valid PDF to show off, and the most fun part was making the CRC32 check succeed. If the checksum had been based on a cryptographic hash function, it would've been essentially impossible, but fortunately CRC32 can be reversed simply by solving a system of linear equations.
Wouldn't this be considered cheating according to the submission?
> The easiest way to do that, of course, is to seek the source file on the disk, open it, and print its contents. That may be done, but it is considered cheating; besides, the program might not know where the source file is, it may have access to only the compiled data, or the programming language may simply forbid that sort of operations.
Seems like that would only work for languages where the last returned value is printed as-is when running it. Other languages wouldn't print `""` but have no output instead.
https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_Ref...