Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A Haskell program that prints out a Perl program that prints out... (sigfpe.com)
54 points by caustic on March 14, 2011 | hide | past | favorite | 2 comments


Apparently these are called "ouroboros programs". http://asiajin.com/blog/2009/09/22/uroboros-programming-with... (which serves an empty page to me right now) used to have a period-11 cycle of programs. I wrote a period-3 program (http://www.stratigery.com/source.html#Ouroboros).


http://golf.shinh.org/reveal.rb?Quine/shinh+%28C+C%2B%2B+Rub...

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.

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...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: