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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Mazeppa: A modern supercompiler for call-by-value functional languages

189 点作者 Jhsto10 个月前

6 条评论

batterseapower10 个月前
My PhD was on supercompilation for Haskell (thanks for the cite in the repo :-))<p>Cool to see that people are still working on it, but I think that the main barrier to practical use of these techniques still remains unsolved. The problem is that it&#x27;s just so easy for the supercomplier to go into some crazy exponential blowup of function unfolding, making the compilation step take impractically long.<p>Even if you avoid a literal exponential blowup you can easily end up generating tons of specializations that bloat your code cache but don&#x27;t reveal any useful optimization opportunities&#x2F;are infrequently used in practice. Similar performance problems also plague related techniques like trace-based JITs, even though the trace JIT happens at runtime and thus has access to strictly more information about the frequency with which a trace might be used.<p>You can try to use annotations like the @extract proposed in the article to control these problems, but it can be hard to predict in advance when this is going to occur.<p>One interesting research direction might be to use deep reinforcement learning to try to guide the generalization&#x2F;termination decisions, where the reward is based on A) whether the unfolding leads to a tie-back later on, and B) to what extent the unfolding allowed deforestation&#x2F;beta reduction to take place.
评论 #40967131 未加载
评论 #40964893 未加载
parhamn10 个月前
That was such a good Readme. Wonderful explanations for those unfamiliar with the space, full examples, a bit of history&#x2F;context. Thanks!
评论 #40961915 未加载
08234987234987210 个月前
Is the manual annotation is because deciding whether or not a graph will blow up upon supercompilation by trying, but checking for blowup during the process, doesn&#x27;t work?<p>&gt; <i>In Mazeppa, we have call-by-value functions and call-by-name (call-by-need) constructors, which 1) makes deforestation possible and 2) preserves the original semantics of code.</i><p>Are there any other notable differences between this approach and call-by-value constructors? (I guess one might have to carry around the original context in closures for a little while, but presumably even that disappears in residual programs?)<p>[Stepan Razin lost his black hat during his ride, but the supercompiler has already removed Ivan Mazepa&#x27;s?]
评论 #40961237 未加载
faizshah10 个月前
I wonder how the debugging experience is, it must be pretty difficult to generate correct source maps.
voldacar10 个月前
Cool. How necessary is the type system? Could you make something similar for lispy languages?
评论 #40964779 未加载
keiferski10 个月前
The likely origin of the name, if you’re curious:<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mazeppa_(poem)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mazeppa_(poem)</a>
评论 #40961155 未加载
评论 #40964841 未加载
评论 #40961087 未加载
评论 #40960806 未加载