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.

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

189 pointsby Jhsto10 months ago

6 comments

batterseapower10 months ago
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 months ago
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 months ago
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 months ago
I wonder how the debugging experience is, it must be pretty difficult to generate correct source maps.
voldacar10 months ago
Cool. How necessary is the type system? Could you make something similar for lispy languages?
评论 #40964779 未加载
keiferski10 months ago
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 未加载