983 points · by codeulike · 13y ago · 177 comments
http://rubysource.com/meet-fifteen-ruby-core-committers/
He lists his "hobby in programming" as: "writing a Quine and enjoying esoteric programming."
https://github.com/tric/trick2013/blob/master/mame1/entry.rb
from TRICK2013 (The 1st Transcendental Ruby Imbroglio Contest for rubyKaigi)
Fortunately, he can correct it without blowing out his Ascii art by deleting the extra space between '##' and 'Quine'.
I'd issue a pull request myself, but it'd be like me putting soy sauce on a piece of Jiro Ono's sushi. I am completely unworthy.
https://github.com/mame/quine-relay/commit/b9322a12e9598911f...
The hashes are automatically generated, it turns out.
I've started looking through it. It's very clever, most of it beyond my ken, but even the technique with the image template of '#'s is a treat when you start to see how it works.
This project isn't code, it's art.
Edit:
Heh, Brainfuck, Whitespace, Logo... and notice they're all in alphabetical order?
There's even a Rake task to generate a Makefile that runs all the 50 multiquines and uses the dependency tracking of make to determine the order of execution instead of running the 50 commands one after the other in the same rule.
It's like everything in this project is incredibly elegant and self-referential.
INTERCAL has many other features designed to make it even more aesthetically unpleasing to the programmer: it uses statements such as "READ OUT", "IGNORE", "FORGET", and modifiers such as "PLEASE". This last keyword provides two reasons for the program's rejection by the compiler: if "PLEASE" does not appear often enough, the program is considered insufficiently polite, and the error message says this; if too often, the program could be rejected as excessively polite. Although this feature existed in the original INTERCAL compiler, it was undocumented.
jasmin QR.j QR.j:2: Warning - Syntax error.
^ QR.j:2: Error - Couldn't repair and continue parse.
^ QR.j: Found 2 errors
And then completely craps out at the badly generated Java. Any idea of what goes?
I started a tiny stub post here, where I'd like to dig into the code over the next couple of days: http://vedantmisra.com/2013/07/yusuke-endohs-amazing-quine-r...
I also made an EC2 AMI, ID ami-744b351d, for anyone who would like to try this themselves.
https://github.com/mame/quine-relay/blob/master/src/code-gen...
Same fellow who did the "rotating globe" quine a few years back:
Link to a description of what this actually is: https://github.com/mame/quine-relay
[1] http://users-cs.au.dk/danvy/sfp12/papers/byrd-holk-friedman-... [2] http://www.infoq.com/presentations/miniKanren [3] https://github.com/webyrd/quines
The talk is amazing and hilarious.
On point, if the code is not generated in this fashion, there is assuredly a "work smart not hard" trick that drastically simplifies the problem.
The code generator is included in the repo: src/code-gen.rb
There's nothing wrong with not loving programming, but calling people who clearly do "sad" because of it, is a bit, well, sad.
Can someone correct me if I'm wrong?
And this program, my friends? This is art.
What is sad is that the author probably has no plan to explain how it was accomplished, which prevents anyone from learning from this.
I don't think so.
This is a relatively common form of humor. A great achievement followed by a realization of the cost of that achievement.
"I just won my 1000th game of <insert video game>! ...I should go outside."
https://github.com/SilasX/QuineRelayFiles
The intermediate source files I've been able to generate so far are in /output_files:
https://github.com/SilasX/QuineRelayFiles/tree/master/output...
Edit: Direct link to the go file:
https://github.com/SilasX/QuineRelayFiles/blob/master/output...
Edit2: I ended up copying so much of what was already there that I re-did this as a fork, adding my contributions in two directories (installation and intermediate):
https://github.com/SilasX/quine-relay
So far I'm stuck at an issue with the Pascal compiler not accepting long strings, which can be fixed either with a compiler switch or by editing the source earlier in the relay.
https://github.com/mame/quine-relay/commit/5d8c1e61a5012b9b5...
(Replying to self because I can't further edit that comment.)
I also made an EC2 AMI, ID ami-744b351d, for anyone who would like to try this themselves.
I started a tiny stub post here, where I'd like to dig into the code over the next couple of days: http://vedantmisra.com/2013/07/yusuke-endohs-amazing-quine-r...
I posted about it earlier in a reply here to OP.
QR.pas(1,32) Error: Constant strings can't be longer than 255 chars gfortran -o QR QR.f && ./QR > QR.f90
gfortran: internal compiler error: Killed (program f951)
Giving up now.Here it is on Go playground. It can be gofmt'ed there. http://play.golang.org/p/p4TS3CAYuh
Also the SVG to ASCII mapping is cool!
I believe he chose the symbol Ouroboros to represent the "immortality through change" of the code. In one story... Ouroboros was an immortal snake who constantly shed his skin, and took on many forms.
Similarly, this code constantly changes form, yet is immortal. While it changes form, it manages to keep its identity.
The Star of David is incidental. As far as I know... it was added to the Ouroboros symbol in the anime/manga Full Metal Alchemist, but that rendition is perhaps the most famous artistic rendition of Ouroboros in recent culture.
Ouroboros had some connotations in the classical psudo-science of Alchemy as well. So perhaps there is an earlier version of Ouroboros + Star of David.
Wheel of Time series begs to differ.
[1] http://www.truthperfected.com/2012/12/seal-of-solomon.html
It's not like I would know the standard symbol for Shintoism unless I googled it.
Ex: Wrath's tattoo is in his eye:
http://images1.wikia.nocookie.net/__cb20130406001619/fma/ima...
b) It's semantically relevant
(Probably the latter. Same goes for the typo in the copyright notice in the end.)
Today, I have seen true madness.
If computer languages were evolving organisms, may this be a metaphor how genetic/chromosome encoding reshuffles itself, and this approximates some common minimalist packaging of the DNA among all these fifty(++?) programming languages? Can we consider this Quine Relay as a `prequel' ancestral "Hello Dad" gene, and also, how its wonderful aesthetic creativity, familiar layperson recognizable and understandable information and charming symbols at myriad representation levels, is enhancing its survival as a persistent executable(living?) `gene-meme'? Eg, is anyone else posting some of this on Facebook?
It is a fun exercise to understand the theorem and its proof (and still probably easier than creating an actual quine).
int array = { ... } // holds the source code,
// except its own representation
int array_index; // The index in the source code
// (where the actual integers in
// array interpreted as source appear)
for i = 0 to array_index:
print (array[i] as an ASCII character)
for i = 0 to array_length:
print (array[i] as integer ++ ", ")
for i = array_index + 1 to array_length:
print (array[i] as an ASCII character)
The core idea is that you can interpret `array` in two ways, as an array of integers or an array of ascii characters representing the program source. The only difficult part is adjusting array_index. With a little effort, this can be scaled to a chain of languages.In this case, however, the function F happens to be the composition of a bunch of individual functions. So F is equivalent to Rexx ∘ R ∘ Python ∘ Prolog, but with many more functions composed than I am willing to type right now. This doesn't change the nature of what we're searching for, which is simply a fixed point of a given function. Realistically, of course, it makes it more difficult and impressive for someone to actually accomplish, but mathematically/computationally speaking it's the same thing.
This is a neat project but somehow the implementation is a lot less mind bending than the definition. Which is rather the opposite of what I experienced when I first heard of a Quine and figured out how to write one (http://en.wikipedia.org/wiki/Quine_(computing), Turbo Pascal in my case, heh).
This smacks of something else, perhaps art.
EDIT: To clarify, there's actually a wrapper script on top of it all that tells the first script to execute, storing its output in file 2, then execute file 2 with language 2, then execute file 3 with language 3, and so on.
That post discusses six languages but others can be easily added.
This is relevant to any similar cool thing what gets submitted on HN.
"what" is interesting, "how" is much more interesting.