TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Haskell program that prints out a Perl program that prints out...

54 pointsby causticabout 14 years ago

2 comments

bedigerabout 14 years ago
Apparently these are called "ouroboros programs". <a href="http://asiajin.com/blog/2009/09/22/uroboros-programming-with-11-programming-languages/" rel="nofollow">http://asiajin.com/blog/2009/09/22/uroboros-programming-with...</a> (which serves an empty page to me right now) used to have a period-11 cycle of programs. I wrote a period-3 program (<a href="http://www.stratigery.com/source.html#Ouroboros" rel="nofollow">http://www.stratigery.com/source.html#Ouroboros</a>).
selesabout 14 years ago
<a href="http://golf.shinh.org/reveal.rb?Quine/shinh+%28C+C%2B%2B+Ruby+Python+PHP+Perl%29_1194650418&#38;rb" rel="nofollow">http://golf.shinh.org/reveal.rb?Quine/shinh+%28C+C%2B%2B+Rub...</a><p>Here is a 396 byte C program that prints a C++ program that prints a Ruby program that prints a Python program that prints a PHP program that prints a Perl program, that prints the original C program.<p>Coincidentally that program is the same in all languages :) it is a polygot. This is definitely a much harder problem than just cycling through the languages...