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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Infinite Recursion

59 点作者 luccastera超过 15 年前

3 条评论

Periodic超过 15 年前
This had me laughing out loud:<p>"The same mistake is done on the Computer Language Benchmark Game. There's an Array sorting benchmark where Haskell just blows away even hand-optimized C. The secret is that the benchmark never prints out the contents of the sorted array. The C compiler isn't smart enough to recognize that the array is never actually used anywhere, but Haskell is, and so the entire benchmark basically compiles down to the equivalent of "int main() { return 0; }"."
yangyang超过 15 年前
He forgot C! It's not in the language spec, but gcc will optimize tail calls, with -O2 or above.
amichail超过 15 年前
From: <a href="http://stronglytypedblog.blogspot.com/2009/08/scala-tail-recursion.html" rel="nofollow">http://stronglytypedblog.blogspot.com/2009/08/scala-tail-rec...</a><p><i>If the recursion is indirect, for example, Scala cannot optimize tail calls, because of the limited JVM instruction set.</i><p>Why is that?
评论 #803818 未加载