by RyanZAG · 13y ago · 0 comments
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?
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.
[edited to improve wording]
And this program, my friends? This is art.
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.
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.
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."