Live data from Hacker News

A Ruby program that generates itself through a 128-language quine loop

github.com

41–50 of 63 posts

Re: A Ruby program that generates itself through a 128-language quine loop

#41

Earlier quoted context omitted.

It's easier in some languages than others. There is a delight in doing it, but don't overdo the anticipation. I've found greater delights in programming.

> It's easier in some languages than others. Yes, it seems Lisp wouldn't be appropriate for this.

I mean, isn't generating quines and twines one of the examples used to show of MiniKanren?

William Byrds presentations of MK are absolutely delightful, by the way.

Re: A Ruby program that generates itself through a 128-language quine loop

#42
This issue imploring Yusuke Endoh to write a paper about it is amusing:

https://github.com/mame/quine-relay/issues/10

> p-e-w:

> This is more than a cool program – it's a computer science breakthrough! Apparently, you have discovered a method for constructing quines based on an arbitrary blueprint involving any amount of languages. > > Please write a technical paper describing your approach. I'm sure you'll have no trouble finding a CS journal that will publish it.

> mame:

> Okay I'll submit to the Journal of Universal Rejection.

Later:

> mame:

> I'll soon publish a book, "The world of obfuscated, esoteric, artistic programming". The book explains how to write a uroboros quine. Hence, I proudly close this issue.

> It also contains my almost all (about forty) works, including alphabet-only Ruby program, radiation-hardened quine, etc., and explains many techniques to write such programs.

> You can buy my book on amazon.co.jp. Unfortunately, it is written in Japanese, yet another esoteric language. I hope anyone can translate to English.

Re: A Ruby program that generates itself through a 128-language quine loop

#43

Last December I had the itch to do some blogging. As it happens, I wrote a four part series that explains in detail how to write quines and quine relays. The initial post can be found at https://drcabana.org/quine/ I am a longtime lurker and finally decided to join in order to comment on this thread. I hope that it is not inappropriate to post a link to my own take on this material. If it is, please accept my apologi…

Great write up, thanks for posting.

Re: A Ruby program that generates itself through a 128-language quine loop

#44
post #5

This was written by Yusuke Endoh, who also wrote this submission to the IOCCC that I remember being arguably more astonished when I saw it for the first time: https://www.youtube.com/watch?v=QMYfkOtYYlg (ASCII fluid dynamics).

Wow, that was cool, never found that one when I went on a deep dive after discovering their quine relay. The other amazing ASCII program of theirs that I love is the Qlobe: http://mamememo.blogspot.com/2010/09/qlobe.html?m=1

Re: A Ruby program that generates itself through a 128-language quine loop

#45

This issue imploring Yusuke Endoh to write a paper about it is amusing: https://github.com/mame/quine-relay/issues/10 > p-e-w: > This is more than a cool program – it's a computer science breakthrough! Apparently, you have discovered a method for constructing quines based on an arbitrary blueprint involving any amount of languages. > > Please write a technical paper describing your approach. I'm sure you'll have no t…

No post body was provided.

Re: A Ruby program that generates itself through a 128-language quine loop

#46

Earlier quoted context omitted.

Printing and unquoting strings is enough to write an ordinary quine (although getting it exactly right is still quite subtle). Making a quine relay is substantially more complicated, because you don't just print the quoted string, you have to print the quoted version of a string in a different language, but that unwraps to the same thing 128 applications later! If you still think it's easy, I reckon you should write…

"Easier than polyglot" does not mean "easy". :-) But I took a bit of time to produce a three-language quine relay elsewhere in this thread [1], and it is relatively easy to follow. The quine stuff (and thus every necessary quoting) is done in Ruby here, Python and Java only prints an appropriately quoted string. Of course there should be several intermediate steps to keep the number of quotes reasonable (since it wil…

Great job, respect!

Re: A Ruby program that generates itself through a 128-language quine loop

#47

Earlier quoted context omitted.

It's easier in some languages than others. There is a delight in doing it, but don't overdo the anticipation. I've found greater delights in programming.

> It's easier in some languages than others. Yes, it seems Lisp wouldn't be appropriate for this.

I believe that solution is possible for the Lisp-modified task description:

Write a cyclic quine that reproduces itself through 128 Lisp languages

because we easily have that many, or more.

Re: A Ruby program that generates itself through a 128-language quine loop

#48
This article explains the basic idea:

David Bertoldi's "How to write your first Quine program" https://towardsdatascience.com/how-to-write-your-first-quine...

However, that article is a basic introduction. This 128-language quine loop is beyond expert, bordering on magic.

Re: A Ruby program that generates itself through a 128-language quine loop

#49

Last December I had the itch to do some blogging. As it happens, I wrote a four part series that explains in detail how to write quines and quine relays. The initial post can be found at https://drcabana.org/quine/ I am a longtime lurker and finally decided to join in order to comment on this thread. I hope that it is not inappropriate to post a link to my own take on this material. If it is, please accept my apologi…

Great write up, thanks for posting.

Thanks for the kind words. Now I know at least one person has read it.

Re: A Ruby program that generates itself through a 128-language quine loop

#50
post #30
post #25

Ken Thompson wrote in his famous paper [1] about quines: > If you have never done this, I urge you to try it on your own. The discovery of how to do it is a revelation that far surpasses any benefit obtained by being told how to do it Every once in a while I give them a try but I couldn't yet create one and it frustrates me very much. Afraid of being denied that "revelation" I never dared to read his paper past that…

I hadn't written one until ~30 mins ago [1]. I cheated and looked at a Java quine (not particularly elegant, but easy to see what is going on.), but I wrote one for Virgil. Just think string substitution; a string with a hole in it and you substitute a copy of the string, quoted into the hole. Just one substitution suffices. [1] https://github.com/titzer/virgil/blob/master/apps/Quine/Quin...

Nice, this Go version satisfies gofmt:

https://github.com/62726164/quine

Post reply on HN