Quine Relay
github.com
github.com
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.
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.
https://github.com/mame/quine-relay/commit/b9322a12e9598911f...
The hashes are automatically generated, it turns out.
This project isn't code, it's art.
Edit:
Heh, Brainfuck, Whitespace, Logo... and notice they're all in alphabetical order?
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.
I used to make fun of Intercal, until I had to do with a Simulink model that made use of FROM blocks.
It's just as retarded as you'd expect. It's as if someone intentionally decided to take a step back from structured programming, and then some more steps back.
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.
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
Can someone correct me if I'm wrong?
Looking at the front page of HN, I think it's pretty safe to say it's moved a fair distance from news of only VCs, startups and such to the realm of what we find interesting. This is interesting. It's not useful, particularly well built or even presentable at a sales meeting. But it is interesting.
What function is the Mona Lisa accomplishing behind layers of glass, with security guards posted 'round the clock, in a museum in France?
The point of contention here is that someone of that level of intellect has "wasted" their talent on art, rather than productivity, which "should" come first.
For varying definitions of "should" and "wasted", of course.
P.S. Knitting a sweater takes forever too. Especially if it has buttons.
I don't know what could cause somebody to adopt such a twisted notion, but I think the roots of it go deeper than I care to know.
And this program, my friends? This is art.
I hope you're just being sarcastic.
Nor will I, or much of anyone else, I imagine. I respect it because it stimulates my mind. My imagination is moved by it in much the same way that it's moved by holding an acorn in my hand while contemplating a fully grown oak tree. Or studying the math that causes z <- z^2 + C to describe a ridiculously intricate shape. Or implementing my own minimal Lisp interpreter from scratch. Or trying to understand the Banach-Tarski paradox. These things stimulate my sense of wonder because they're like a magic trick, but there's no trickery involved. And when I contemplate them, I learn more about the world. Art cannot aspire to much more than that.
Yet people gladly upvote stories about computers implemented insite Minecraft and life-size spaceships made out of Lego blocks. Are you saying it has nothing to do with the difficulty involved? I doubt this story would be equally well received if there was some easy way to achieve the same result. If you take difficulty of the task out of the equation, what will be left? How much of what's left is genuine creativity and skill, and how much is mere patience?
No, of course not. The "simply" was what I was disagreeing with.
Also, in what way is this exercise not exploratory?
(If you are looking for other people to explain to you how to appreciate art, you are going to have a bad time.)
Eli Siegel explains in his great essay "The Serious Aspect of Snobbery":
Snobbery is the unwillingness to like something, unless at the same time it
makes one feel more important;...
[It] is the inability or lack of desire to appreciate justly. >...art of that sort is garbage. There are plenty of people
who vehemently defend that garbage, but it doesn't make
it any less wasteful use of human time and attention.
...is your opinion. Opinion that as downvoters have noted, is full of snobbery. Not even mildly vindicated snobbery that's tolerated on this forum like picking your religion (I.E. favorite IDE, programming language etc...) which someone could assert with reasonable confidence with anecdotes of personal experience at least; it was wholly devoid of intellectual merit... and was snobbery.That's not a personal attack. I don't know you personally and nor was it an attack. I felt it was merely an observation. But If you took an observation as an attack, then doesn't that speak to the validity of the quote?
I don't appreciate a whole swath of what is considered "modern art" either (though I do like Dada, if anything for it's quirkiness that I find interesting). But never have I called someone else's creation of time and effort "garbage" purely due to my lack of appreciation.
I think the notion that purpose and intent behind art is far more important than the amount of effort involved in its creation has considerable amount of intellectual merit. Even more so considering how unpopular it is. Whether people choose to read the whole comment, or prefer to see "bla, bla, bla, garbage!" is a different matter.
>Whether people choose to read the whole comment, or prefer to see "bla, bla, bla, garbage!" is a different matter.
Interesting that you assume we didn't read the rest of the comment. I assure you most of us do prefer to take things in context. It's OK to look up once instead of looking down all the time.Purpose is ancillary to art. Art without purpose and merely is as art has been a cornerstone of creative expression since art has existed. The fact that you prefer to inject purpose behind it now has no bearing whatsoever on what people will consider artistic. You're not the arbiter of worth or taste.
I would however claim that the vast majority of art does stimulate the mind, though it may not stimulate yours without some additional effort. Indeed just about anything in the world is capable of stimulating your mind if you look closely enough at it, to paraphrase John Cage.
[1] ... or, if we take a 'vibrant matter' / 'object oriented ontology' view of the world, stimulate something.
> Pour qu’une chose soit intéressante, il suffit de la regarder longtemps.
http://flaubert.univ-rouen.fr/correspondance/conard/outils/1...
“If something is boring after two minutes, try it for four. If still boring, then eight. Then sixteen. Then thirty-two. Eventually one discovers that it is not boring at all.” ― John Cage
What is sad is that the author probably has no plan to explain how it was accomplished, which prevents anyone from learning from this.
In the "spoiler" section:
""" Normally quines are made like this:
s = (something that generates your own source code)
puts s
At the same time, a Ruby program that outputs a Perl program looks like this: puts "print(\"...\");"
If you combine these with quine methods, you get a multi-quine that goes between Ruby and Perl: s = (something that generates your own source code)
puts "print(\"#{ s }\");"
Theoretically you just repeat this process. Except, there are the following practical problems: - Need proper escaping
+ Lots of old languages do not support C style of escape sequences.
+ Depending on languages, you need to escape interpolations.
- Cobol and Fortran programs have troublesome constraints
+ Need 7 spaces on the left and less than 80 columns per line, etc.
- Naive escaping will cause intermediate files to get too large.
+ JVM Strings have 64K size limit.
+ Languages like Intercal and Whitespace will become unbearably slow.
In order to avoid these, Perl requires something like ppencode, Java needs LZW compression to avoid string size limits. Cobol's line length limit was satisfied using Closure generator, Fortran's line length limit was satisfied using Coffeescript generator. People who are interested should see the generated code.
"""In general, there isn't any standard method to making quines. You just keep on tweaking the code until the input and output matches, mostly by trial and error.
[edited to improve wording]
A truly worthwhile bitching would take at least an hour.
I don't think so.
[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.
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."
Here it is on Go playground. It can be gofmt'ed there. http://play.golang.org/p/p4TS3CAYuh
gfortran -o QR QR.f && ./QR > QR.f90
gfortran: internal compiler error: Killed (program f951)
Giving up now.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 charsAlso the SVG to ASCII mapping is cool!
b) It's semantically relevant
(Probably the latter. Same goes for the typo in the copyright notice in the end.)
Ex: Wrath's tattoo is in his eye:
http://images1.wikia.nocookie.net/__cb20130406001619/fma/ima...
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.
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?
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.
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.
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.
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.It is a fun exercise to understand the theorem and its proof (and still probably easier than creating an actual quine).
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.