14 ms·
Quine Relay
- joeblau 13y agoHoly crap. Codeception, now I can write in one language and run in every language :)
- RyanZAG 13y agoThat is both the most incredible thing I've ever seen, yet also by far the saddest thing I've ever seen. Props to the author for taking dedication to a whole new level. Link to a description of what this actually is: https://github.com/mame/quine-relay https://github.com/mame/quine-relay
- GuiA 13y agoI'm sorry, how is that sad?
- eksith 13y agoIndeed. That's a transmutation circle of awesome.
- Sealy 13y agoI think he's referring to the relative uselessness of the code. Yes it would have taken a lot of time, talent and intellect to produce but from what I understand is of relatively little use? Can someone correct me if I'm wrong?
- eksith 13y agoThere has been a spat of comments criticizing stories along the lines of "what use does it have?" As pointed out previously on all of them, and at the risk of sounding redundant, this is "Hacker News", not "Only Useful Things News" or even "Mildly Interesting News". 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.
- brey 13y agoyou've just described art.
- bennyg 13y agoCame to say this, but I could not say it with the brevity you did. What function is the Mona Lisa accomplishing behind layers of glass, with security guards posted 'round the clock, in a museum in France?
- saraid216 13y agoThat's the entire point of a quine.
- arianvanp 13y agoThis dude's State Alchemist title is probably Fullcode Alchemist
- hnriot 13y agopossibly that someone clearly very smart wasted his/her intellect doing this, rather than advancing the species by curing obesity, heart disease and cancer?
- scott_s 13y agoWhich is a silly notion. Everyone needs entertainment and to have fun. Some people do it in different ways than others.
- Noxchi 13y agoThe first two are already curable (with food).
- raldi 13y agoDo you feel the same way when someone bakes a cake, takes a walk, watches a sporting event, knits a sweater, or writes a poem?
- ionforce 13y agoI think that people view art as a side effect of abundance. It is something that naturally arises given a surplus of some thing. 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.
- gambler 13y agoThe effort involved in doing this is incomparable with the things you just mentioned. This is nothing like baking a cake, more like spending thousands of dollars to build a life-sized Eiffel Tower out of matchsticks.
- cpayne 13y agoIt depends on the quality of cake you are eating. There's a massive difference between a chocolate birthday cake for a 4 yr old or Profiteroles http://en.wikipedia.org/wiki/Profiterole http://en.wikipedia.org/wiki/Profiterole
- dustingetz 13y agoIts not sad at all. Really good programmers can do things that ordinary programmers think impossible. This code was probably generated. Here is a paper on quine generation[1], and the authors have a very popular talk where they livecode a quine generator; that is, they livecode a program that generates an infinite list of quines[2] (source code from talk [3]). [1] http://users-cs.au.dk/danvy/sfp12/papers/byrd-holk-friedman-paper-sfp12.pdf http://users-cs.au.dk/danvy/sfp12/papers/byrd-holk-friedman-... [2] http://www.infoq.com/presentations/miniKanren http://www.infoq.com/presentations/miniKanren [3] https://github.com/webyrd/quines 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.
- sampo 13y ago> This code was probably generated. The code generator is included in the repo: src/code-gen.rb
- pizza 13y agoart
- kragen 13y agoSaying that hacking is "sad" is arrogantly elevating your own limited worldview over the worldview of hackers. Perhaps someday you could hope to become as awesome as the person you're criticizing, but first you have to realize that being a hacker is something worth aspiring to.
- skrebbel 13y agoIf you think that anything about this is sad, then you simple don't love programming enough. There's nothing wrong with not loving programming, but calling people who clearly do "sad" because of it, is a bit, well, sad.
- Keale2 13y agoI feel like everybody is taking this comment the wrong way. It sounds like a compliment followed by a joke. 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."
- quchen 13y agoIn case someone is able to run this beast, I'd appreciate an upload of the intermediate source files.
- shurcooL 13y agoYeah, I want to see the golang code.
- deleted 13y ago[deleted]
- sikhnerd 13y agoI gave it a (very) quick go, but failed and I don't have neither the time nor skill to debug it, I'll throw up what got generated so far if you're interested. https://twitter.com/sikhnerd/status/356920512770867200 https://twitter.com/sikhnerd/status/356920512770867200
- mbillie1 13y agoI'm grabbing the packages (in Ubuntu 12.04, just sub "clojure1.4" with "clojure" and you should be able to grab them all)... will attempt to run it once I get this all set up.
- deathwarmedover 13y agohere's my efforts so far on OS X Lion: https://gist.github.com/dwo/6004592 https://gist.github.com/dwo/6004592
- tome 13y agoWhy's there a Star of David in the middle?
- quchen 13y agoa) The author is Jewish b) It's semantically relevant (Probably the latter. Same goes for the typo in the copyright notice in the end.)
- msvan 13y agoBoth semantically and semitically relevant, in other words.
- tome 13y agoI did consider a) but I'm pretty sure "Yusuke Endoh" is not Jewish.
- deleted 13y ago[deleted]
- michaelmwu 13y agoHe's Japanese, and one of the authors of the Ruby programming language
- saraid216 13y agoBeing Japanese doesn't actually preclude you from being Jewish. It makes it highly unlikely... but not impossible.
- michaelmwu 13y agoTrue.. but you're more likely to find a Japanese Mormon than a Japanese Jew.
- anateus 13y agoIt's actually a transmutation circle symbol from the manga/anime Fullmetal Alchemist
- memming 13y agoOh. My. God.
- epidemian 13y agoFascinating. Even the README generator is on another level of meta: https://github.com/mame/quine-relay/blob/master/src/README.md.gen.rb https://github.com/mame/quine-relay/blob/master/src/README.m...
- polemic 13y agoAnd: https://github.com/mame/quine-relay/blob/master/QR.rb https://github.com/mame/quine-relay/blob/master/QR.rb This project isn't code, it's art. Edit: Heh, Brainfuck, Whitespace, Logo... and notice they're all in alphabetical order?
- quchen 13y agoBrainfuck is fairly practical compared to Unlambda and INTERCAL.
- jlgreco 13y agoI have to admit that I was a little let down to see that APL was not included. Not in the same class as those languages... technically.
- Jach 13y agoOr J to keep things ascii. Though I would have loved to have seen Malbolge. (http://en.wikipedia.org/wiki/Malbolge http://en.wikipedia.org/wiki/Malbolge) It's already super impressive, but with some extra work it could be hyper impressive!
- mbillie1 13y agoPerhaps my favorite paragraph on all of wikipedia: 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.
- terabytest 13y agoAnyone care to explain how this actually works?
- SilasX 13y agoPer the explanation linked in the discussion [1], the initial file generates code in another language. That code, when executed, generates code in yet another language. The process continues until the output is the code of the original file. [1] https://github.com/mame/quine-relay https://github.com/mame/quine-relay
- terabytest 13y agoWhat is unclear to me is how the final program manages to represent the entire code (thus the entire language loop). Wouldn't doing that make the source code recursive and infinite? Or am I missing something important?
- SilasX 13y agoNo more recursive or infinite than any other self-replicator that has intermediate "bodies". 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.
- recuter 13y agohttps://github.com/mame/quine-relay/blob/master/src/code-gen.rb https://github.com/mame/quine-relay/blob/master/src/code-gen... 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) http://en.wikipedia.org/wiki/Quine_(computing), Turbo Pascal in my case, heh). This smacks of something else, perhaps art.
- woobles 13y ago
- avivo 13y agoThis should be in MOMA.
- k-mcgrady 13y agoThis is really cool. Considering installing Ubuntu to give it a try (don't think I could be bothered trying to get all those packages manually).
- Axsuul 13y agoSomeone should create a vagrant box for this.
- codereflection 13y agoIf someone tries this, please post a video from start to finish. This is incredible.
- mrwnmonm 13y agowhy did you choose that order, is there a reason for it?
- srin 13y agoI think it's just alphabetical, so no particular path through the languages that he saw as easier/harder
- ionforce 13y agoI think the code has a generator framework, so the fact that they are alphabetical may just be convenient/arbitrary; the code could be generated to run in any order (I think).
- sold 13y agoSee also http://blog.sigfpe.com/2011/01/quine-central.html http://blog.sigfpe.com/2011/01/quine-central.html That post discusses six languages but others can be easily added.
- danso 13y agoI know we shouldn't care about the source, crazy-insane as he obviously is, but FWIW, the author is Yusuke Endoh, one of the Ruby core members. RubySource had an interview with him here: http://rubysource.com/meet-fifteen-ruby-core-committers/ http://rubysource.com/meet-fifteen-ruby-core-committers/ He lists his "hobby in programming" as: "writing a Quine and enjoying esoteric programming."
- minikomi 13y agoIndeed, the Japanese ruby community has quite a few interesting characters like this.. In fact, someone even wrote a book about using ruby as a base for creating esoteric languages! http://www.amazon.co.jp/Ruby%E3%81%A7%E4%BD%9C%E3%82%8B%E5%A5%87%E5%A6%99%E3%81%AA%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E8%A8%80%E8%AA%9E-~Esoteric-Language~-%E5%8E%9F-%E6%82%A0/dp/4839927847 http://www.amazon.co.jp/Ruby%E3%81%A7%E4%BD%9C%E3%82%8B%E5%A...
- adamnemecek 13y agoI really wish there was a translation of this.
- deleted 13y ago[deleted]
- YzzYz 13y agosee also his "music box quine" https://github.com/tric/trick2013/blob/master/mame1/entry.rb https://github.com/tric/trick2013/blob/master/mame1/entry.rb from TRICK2013 (The 1st Transcendental Ruby Imbroglio Contest for rubyKaigi) https://sites.google.com/site/trickcontest2013/ https://sites.google.com/site/trickcontest2013/
- fakeer 13y agoWow! All of them are Japanese. Ruby is practically made in Japan then. Nice to know this.
- tonylampada 13y ago
- dpayne 13y agoHere's another one of his projects where you can write ruby script using just underscores. https://github.com/mame/_ https://github.com/mame/_
- duggieawesome 13y agoYeah this is crazy. Just a taste, this is "Hello, world!" in Intercal. https://en.wikipedia.org/wiki/INTERCAL#Hello.2C_world https://en.wikipedia.org/wiki/INTERCAL#Hello.2C_world
- jetru 13y agoMy thoughts went from "This is amazing" to "But he must have taken a lot of time and brainpower to do this" to "This is useless really" to "So what? If I wanted to do that I would take a year perhaps if I ever could" to "This is amazing"
- boomlinde 13y agoAs if in line with some sort of sick and twisted version of the Kübler-Ross model
- zabcik 13y agoThe best part is that the cycle is in alphabetical order.
- scott_karana 13y agoFantastic! Same fellow who did the "rotating globe" quine a few years back: http://mamememo.blogspot.ca/2010/09/qlobe.html http://mamememo.blogspot.ca/2010/09/qlobe.html
- chii 13y agoi found that to be even more amazing! ;D
- e3pi 13y agoRemember those delightful self-referential Scott Kim creations in Godel Escher Bach? Here, made alive, and becomes most everything in the known coder's world. A super-chameleon quine mime.
- vedant 13y agoI successfully compiled every intermediary, and posted all of the code in a gzipped tarball here: http://goo.gl/EBZFV http://goo.gl/EBZFV. 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-relay/ 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.
- NanoWar 13y agoThe miracle happens here: https://github.com/mame/quine-relay/blob/master/src/code-gen.rb https://github.com/mame/quine-relay/blob/master/src/code-gen... Also the SVG to ASCII mapping is cool!
- scrumper 13y agoI feel awful for pointing this out, but the author spelled Copyright incorrectly in the last line. 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.
- cbhl 13y agoWouldn't you also need to fix src/QR.rb.gen.rb?
- scrumper 13y agoYeah. Like I said, not worthy :) 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.
- ilyanep 13y agoI feel like the fact that you took the time to figure out how to fix it makes you at least somewhat worthy.
- sans-serif 13y agoWhen I first spotted that, I wasn't sure if it was intentional. Maybe the comments are a part of the input.
- quchen 13y agoBut then the cycle would probably not close anymore - the end result would not be the initial code.
- codeulike 13y agoHe's fixed it now!
- deleted 13y ago[deleted]
- 13y ago
- jcromartie 13y agoThe code that generates the quine is included. There's still lots of super impressive stuff here, but don't be intimidated thinking he wrote that monster by hand! https://github.com/mame/quine-relay/blob/master/src/code-gen.rb https://github.com/mame/quine-relay/blob/master/src/code-gen...
- deleted 13y ago[deleted]
- JimmaDaRustla 13y agoIf you could go ahead and explain WHY...that'd be grreeeaaaat!
- barbs 13y agoWow, even the source code of the original file is arranged to look like the Star of David surrounded by the dragon-eel thing, Obfuscated-C-contest style: https://github.com/mame/quine-relay/blob/master/QR.rb https://github.com/mame/quine-relay/blob/master/QR.rb
- newsoundwave 13y agoThe dragon-eel thing is an Ouroboros. http://en.wikipedia.org/wiki/Ouroboros http://en.wikipedia.org/wiki/Ouroboros
- tomasien 13y agoThis is amazing. Think the concept can be taken to another level in some way? Begin a universal translator of some small level?
- martin_ 13y agoThe arrangement of the languages is alphabetical, did this complicate things at all? Would it have been simpler in a different order (though less elegant)?
- mncaudill 13y agoI wrote a post about how to do these multi-lingual quines a while back: https://nolancaudill.com/2011/01/01/how-to-build-a-quine/ https://nolancaudill.com/2011/01/01/how-to-build-a-quine/
- soheil 13y agometa(N^K)
- zw123456 13y agoThis reminds me very much of the various types of mathematical exercises that seem to be very esoteric and academic but turned out to be very useful in some solution in physics (eg. lorentz contractions). I would not be surprised if some insight indirectly comes from this insanely amazing exercise.
- GhotiFish 13y agoIt terrifies me what this insight might be.
- Rabidgremlin 13y agoIf anyone wants to give this a go. I have created a Vagrant config which installs the OS, tools and runs the chain of programs. You can find it here: https://github.com/rabidgremlin/vagrant-quine-relay https://github.com/rabidgremlin/vagrant-quine-relay
- candeira 13y agoI installed it yesterday. It fails at the point of Jasmin: 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?
- celwell 13y agoI now know what a quine is. And learned of about 15 new programming languages.
- arde 13y agoWhat, no Erlang? Sheesh! Amazing work.
- deleted 13y ago[deleted]
- karangoeluw 13y agoHow does one debug code like this?
- chii 13y agoyou dont. When you reach level zen, you write code that's already bug free :]
- karangoeluw 13y agoThat 'level zen' sounds like a state that doesn't exist.
- codeulike 13y agoNB: I originally posted this with the link pointing to the QR.rb file, which is the main code file and also a piece of Ascii art. Looks like the mods switched the link back to the main project to provide more context. But to have people looking at QR.rb first and then reading about what it does afterwards was the idea. Amazing piece of work by @hirekoke. https://github.com/mame/quine-relay/blob/master/QR.rb https://github.com/mame/quine-relay/blob/master/QR.rb
- inaudible 13y agoAwe inspiring stuff! But as a Ruby illiterate, I am left wondering what it is about the Ruby language that draws in such a level of creative / abstract / esoteric genius to use it as a starting point. Is there something about Ruby in particular, or is just a case of an individual obsessing over a craft?
- zerr 13y agoThis is cool of course, but we are even more interested in knowing the mechanics and how it is done. This is relevant to any similar cool thing what gets submitted on HN. "what" is interesting, "how" is much more interesting.
- _pmf_ 13y agoDay 5462 on the internet. Today, I have seen true madness.
- EGreg 13y agoWell, someone clearly paid attention in Programming Languages class :)
- cbrauchli 13y agoHe should add Subleq or some other OISC! http://en.wikipedia.org/wiki/One_instruction_set_computer http://en.wikipedia.org/wiki/One_instruction_set_computer
- e3pi 13y agoMolecular biology? 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?
- isomorph 13y agoWelcome to social coding: https://github.com/mame/quine-relay/issues https://github.com/mame/quine-relay/issues
- minikomi 13y agoI love his sense of humor too: https://github.com/mame/quine-relay/issues/10 https://github.com/mame/quine-relay/issues/10