Quines (Self-Replicating Programs)
madore.org
madore.org
https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_Ref...
It goes through 128 programming languages to regen its starting point.
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.
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.
BTW this was raised in a cracking corecursive episode recently https://corecursive.com/quines-polyglot-code/
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.
[[dup cons] dup cons]
You run it with the i combinator: [[dup cons] dup cons] i
[dup cons] dup cons
[dup cons] [dup cons] cons
[[dup cons] dup cons]#!/bin/bash
cat $0
```
#!/bin/cat
Example: $ echo '#!/bin/cat' > foo
$ chmod +x foo
$ cat foo
#!/bin/cat
$ ./foo
#!/bin/cat> 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.