TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

54 点作者 caustic大约 14 年前

2 条评论

bediger大约 14 年前
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>).
seles大约 14 年前
<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...