9 ms·
I don't get people's fascination with quines. If your language supports at least two ways of quoting strings and some basic regex replacements, you can cook up
by gambler 8y ago
I don't get people's fascination with quines. If your language supports at least two ways of quoting strings and some basic regex replacements, you can cook up a quine just by starting with an empty string and using double-cursor functionality in any modern editor.
".replace(/^(.*)/, String.fromCharCode(34) + '$1' + String.fromCharCode(34) + '$1')".replace(/^(.*)/, String.fromCharCode(34) + '$1' + String.fromCharCode(34) + '$1')
"Take the previous string, print it inside double quotes, then print it as is."
Is this supposed to be profound? I don't see how this has anything to do with biology or life. It's simply a test of how cleverly you can abuse the syntax of your language.
- FakeComments 8y agoYou don’t see how a self-replicating pattern in an abstract context can serve as a model of self-replicating patterns in practical contexts? Or why studying how different formalisms in language lead to different complexity in constructing such patterns may relate to things like bootstrapping DNA?
- gambler 8y agoI don't see discussions of any of the things you mentioned. I see people falling in love with "clever" code. Quines can be made straightforward. You have two copies of your code. Copy 2 then prints copy 1 twice, creating the replica of the original 2 copies. That's it. Everything else is trickery dealing with language boilerplate and string escapes. Similarly, I'm pretty sure the quine above is not generalizable to any language. It's all about Ruby syntax, not some fundamental property of the program.
- taneq 8y agoWell, the first life form was just a test of how cleverly you can abuse physics, so yeah.
- waynecochran 8y agoMy fascination with quines comes from various proofs, e.g., the halting problem and Godel's incompleteness theorem which make use of self-referential structures. Also self-referential structures form the basis of many other interesting forms like fractals and replication RNA. Quines are just sort of an initial proof of concept that can be extended into more sophisticated forms.
- derefr 8y agoA quine—in a scripting language—is a https://en.wikipedia.org/wiki/Fixed_point_(mathematics) https://en.wikipedia.org/wiki/Fixed_point_(mathematics) of the interpreter, which is kind of profound. A quine in a compiled language isn't anything in particular, though. (I guess you could call it a fixed point of the compiler+target Turing machine, when taken as a single function?)