<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: cfallin</title><link>https://news.ycombinator.com/user?id=cfallin</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Tue, 07 Jul 2026 05:43:41 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=cfallin" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by cfallin in "The acyclic e-graph: Cranelift's mid-end optimizer"]]></title><description><![CDATA[
<p>Oh goodness, that name is so good!<p>(And thanks!)</p>
]]></description><pubDate>Tue, 14 Apr 2026 21:46:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=47771915</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=47771915</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47771915</guid></item><item><title><![CDATA[New comment by cfallin in "The acyclic e-graph: Cranelift's mid-end optimizer"]]></title><description><![CDATA[
<p>Thanks! I haven't studied Graal's IR in detail, no. I'll add it to my reading list...</p>
]]></description><pubDate>Tue, 14 Apr 2026 15:44:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=47767164</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=47767164</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47767164</guid></item><item><title><![CDATA[New comment by cfallin in "The acyclic e-graph: Cranelift's mid-end optimizer"]]></title><description><![CDATA[
<p>OK, cool. I was assuming "escape analysis and type inference" implied a JS JIT -- straight from your comment, no other assumptions intended. But you've got a lot of interesting experience here and thanks for your thoughts.<p>All the best!</p>
]]></description><pubDate>Tue, 14 Apr 2026 15:42:30 +0000</pubDate><link>https://news.ycombinator.com/item?id=47767136</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=47767136</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47767136</guid></item><item><title><![CDATA[New comment by cfallin in "The acyclic e-graph: Cranelift's mid-end optimizer"]]></title><description><![CDATA[
<p>Hi Fil -- thanks for the comment!<p>I think we may be playing in slightly different spaces: unlike a JS JIT, Cranelift doesn't have "super fancy escape/type analysis". We're really targeting the core optimizations (GVN, LICM, cprop, RLE, STLF, various algebraic rules) in a fast compile pass. The RLE+GVN interaction was pretty real in our case, as are interactions between the algebraic rewrites and GVN.<p>You'll note that my main point is that the single fixpoint loop for all of the core rewrites is what we wanted, and what the sea-of-nodes-with-CFG gets us; the egraph (multiple versions of one value) is kind of an aside. One could say: well sure but I could just do a single pass with that fixpoint loop without all the egraph stuff; and, yes, that's what our single rewrite pass <i>is</i>.</p>
]]></description><pubDate>Tue, 14 Apr 2026 15:19:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=47766803</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=47766803</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47766803</guid></item><item><title><![CDATA[New comment by cfallin in "Epsilon: A WASM virtual machine written in Go"]]></title><description><![CDATA[
<p>We have two: fuel and epochs. Fuel (analogous to "gas" as it appears in many VM platforms) is a deterministic count and epochs check an always-increasing counter in shared memory meant to be periodically bumped by another thread. In either case, hitting the limit can be configured to either async-yield back to the event loop (in async mode) or to trap/terminate the Wasm instance. Both are based on instrumentation, i.e., extra code inserted during Wasm-to-machine-code compilation to do these checks at the start of loops and at the top of each function. Epoch instrumentation is cheaper because it's checking a mostly-read-only value in memory (so usually cached) while fuel loads and stores that value constantly from the VMContext.<p>(Core Wasmtime maintainer here, and I built our epochs mechanism when I realized we could do better than fuel if one doesn't need the determinism, only periodic yields)</p>
]]></description><pubDate>Wed, 10 Dec 2025 06:04:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=46214597</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=46214597</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46214597</guid></item><item><title><![CDATA[Exceptions in Cranelift and Wasmtime]]></title><description><![CDATA[
<p>Article URL: <a href="https://cfallin.org/blog/2025/11/06/exceptions/">https://cfallin.org/blog/2025/11/06/exceptions/</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=45838154">https://news.ycombinator.com/item?id=45838154</a></p>
<p>Points: 2</p>
<p># Comments: 0</p>
]]></description><pubDate>Thu, 06 Nov 2025 17:59:32 +0000</pubDate><link>https://cfallin.org/blog/2025/11/06/exceptions/</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=45838154</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45838154</guid></item><item><title><![CDATA[New comment by cfallin in "WASM 3.0 Completed"]]></title><description><![CDATA[
<p>No, it's still behind a flag (and so transitively, exceptions are too, because we built exception objects on top of GC).<p>Our docs (<a href="https://docs.wasmtime.dev/stability-tiers.html" rel="nofollow">https://docs.wasmtime.dev/stability-tiers.html</a>) put GC at tier 2 with reason "production quality" and I believe the remaining concerns there are that we want to do a semi-space copying implementation rather than current DRC eventually. Nick could say more. But we're spec-compliant as-is and the question was whether we've implemented these features -- which we have :-)</p>
]]></description><pubDate>Wed, 17 Sep 2025 23:22:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=45282661</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=45282661</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45282661</guid></item><item><title><![CDATA[New comment by cfallin in "WASM 3.0 Completed"]]></title><description><![CDATA[
<p>> It'll be interesting to see what the second non-browser-based WASM runtime to fully support 3.0 will be (I'm guessing wasmtime will be first; ...)<p>Wasmtime already supports every major feature in the Wasm 3.0 release, I believe. Of the big ones: garbage collection was implemented by my colleague Nick Fitzgerald a few years ago; tail calls by Jamey Sharp and Trevor Elliott last year (with full generality, any signature to any signature, no trampolines required!); and I built our exceptions support which merged last month and is about to go out in Wasmtime 37 in 3 days.<p>The "3.0" release of the Wasm spec is meant to show progress and provide a shorthand for a level of features, I think, but the individual proposals have been in progress for a long time so all the engine maintainers have known about them, given their feedback, and built their implementations for the most part already.<p>(Obligatory: I'm a core maintainer of Wasmtime and its compiler Cranelift)</p>
]]></description><pubDate>Wed, 17 Sep 2025 22:30:28 +0000</pubDate><link>https://news.ycombinator.com/item?id=45282201</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=45282201</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45282201</guid></item><item><title><![CDATA[New comment by cfallin in "TPDE: A Fast Adaptable Compiler Back-End Framework"]]></title><description><![CDATA[
<p>They're hitting another design point on the compile time vs. code-quality tradeoff curve, which is interesting. They compile 4.27x faster than Cranelift with default (higher quality) regalloc, but Cranelift produces code that runs 1.64x faster (section 6.2.2).<p>This isn't too surprising to me, as the person who wrote Cranelift's current regalloc (hi!) -- regalloc is <i>super</i> important to run-time perf, so for Wasmtime's use-case at least, we've judged that it's worth the compile time.<p>TPDE is pretty cool and it's great to see more exploration in compiler architectures!</p>
]]></description><pubDate>Mon, 02 Jun 2025 22:16:13 +0000</pubDate><link>https://news.ycombinator.com/item?id=44163749</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=44163749</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=44163749</guid></item><item><title><![CDATA[Compilation of JavaScript to WASM, Part 3: Partial Evaluation]]></title><description><![CDATA[
<p>Article URL: <a href="https://cfallin.org/blog/2024/08/28/weval/">https://cfallin.org/blog/2024/08/28/weval/</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=41381439">https://news.ycombinator.com/item?id=41381439</a></p>
<p>Points: 6</p>
<p># Comments: 1</p>
]]></description><pubDate>Wed, 28 Aug 2024 16:45:51 +0000</pubDate><link>https://cfallin.org/blog/2024/08/28/weval/</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=41381439</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=41381439</guid></item><item><title><![CDATA[Compilation of JavaScript to WASM, Part 2: Ahead-of-Time vs. JIT]]></title><description><![CDATA[
<p>Article URL: <a href="https://cfallin.org/blog/2024/08/27/aot-js/">https://cfallin.org/blog/2024/08/27/aot-js/</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=41368657">https://news.ycombinator.com/item?id=41368657</a></p>
<p>Points: 93</p>
<p># Comments: 8</p>
]]></description><pubDate>Tue, 27 Aug 2024 15:30:12 +0000</pubDate><link>https://cfallin.org/blog/2024/08/27/aot-js/</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=41368657</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=41368657</guid></item><item><title><![CDATA[New comment by cfallin in "Compilers for free with weval"]]></title><description><![CDATA[
<p>Indeed; the tl;dr is "yes it works on SpiderMonkey, and was designed to do so". Blog post in a few months, I promise!</p>
]]></description><pubDate>Mon, 20 May 2024 03:28:38 +0000</pubDate><link>https://news.ycombinator.com/item?id=40411973</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=40411973</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40411973</guid></item><item><title><![CDATA[New comment by cfallin in "Compilers for free with weval"]]></title><description><![CDATA[
<p>> That is, if x and y are determined only at runtime for power(x, y) then I don't see what can be optimized.<p>Yes, the example in Max's post is specifically assuming one wants to generate a specialized version of `power` where `y` is fixed.<p>To take it back to weval: we can know what the bytecode input to the interpreter is; we provide an intrinsic (part of the "wevaling" request) to indicate that some function argument is a pointer to memory with constant, guaranteed-not-to-change content. That, together with context specialization on PC (another intrinsic), allows us to unroll the interpreter loop and branch-fold it so we get the equivalent of a template method compiler that reconstitutes the CFG embedded in the bytecode.</p>
]]></description><pubDate>Mon, 20 May 2024 03:26:49 +0000</pubDate><link>https://news.ycombinator.com/item?id=40411963</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=40411963</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40411963</guid></item><item><title><![CDATA[New comment by cfallin in "Compilers for free with weval"]]></title><description><![CDATA[
<p>This is indeed a good point and something I want to write about when I eventually do a blog post on weval.<p>A few counterpoints that I'd offer (and what led me to still take this approach):<p>- If the target has sub-par debugging infrastructure, it can be easier to debug an interpreter (which is portable) then apply the semantics-preserving PE. In particular when targeting Wasm outside the browser, there is... not really a good debug experience, anywhere, for that. It was way easier to get an interpreter right by developing on native with gdb/rr/whatever, and then separately ensure weval preserves semantics (which I tested with lockstep differential execution).<p>- Maintenance: if one is going to have an interpreter and a compiler anyway (and one often wants this or needs this e.g. to handle eval()), easier for them both to come from the same source.<p>- Amortized cost: in the Wasm world we want AOT compilers for many languages eventually; there are interpreter ports with no Wasm backends; developing weval was a one-time cost and we can eventually apply it multiple times.<p>- If the semantics of the existing interpreter are quite nontrivial, that can push the balance the other way.  I designed weval as part of my work on SpiderMonkey; extremely nontrivial interpreter with all sorts of edge cases; replicating that in a from-scratch compiler seemed a far harder path. (It's since been done by someone else and you can find the "wasm32 codegen" patchset in Bugzilla but there are other phasing issues with it from our use-case's PoV; it's not true AOT, it requires codegen at runtime.)<p>I don't think the tradeoff is always clear and if one is building a language from scratch, and targeting a simple ISA, by all means write a direct compiler! But other interesting use-cases do exist.</p>
]]></description><pubDate>Sun, 19 May 2024 17:16:33 +0000</pubDate><link>https://news.ycombinator.com/item?id=40408300</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=40408300</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40408300</guid></item><item><title><![CDATA[New comment by cfallin in "Compilers for free with weval"]]></title><description><![CDATA[
<p>weval author here (thanks Max for the blog post!). Also AMA!<p>The talk about weval that Max mentions was at NEU and also CMU; the latter was recorded and is here: <a href="https://vimeo.com/940568191" rel="nofollow">https://vimeo.com/940568191</a><p>I also plan to write up a blog post on weval in depth, plus its application to SpiderMonkey-on-Wasm, in a few months; it's pretty exciting though, currently getting 4-5x speedups on some benchmarks on a decidedly nontrivial interpreter!</p>
]]></description><pubDate>Sun, 19 May 2024 15:33:42 +0000</pubDate><link>https://news.ycombinator.com/item?id=40407589</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=40407589</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40407589</guid></item><item><title><![CDATA[New comment by cfallin in "Cranelift code generation comes to Rust"]]></title><description><![CDATA[
<p>The approach that Cranelift uses is what we call the "aegraph" (talk I gave about it: slides <a href="https://cfallin.org/pubs/egraphs2023_aegraphs_slides.pdf" rel="nofollow">https://cfallin.org/pubs/egraphs2023_aegraphs_slides.pdf</a>, video <a href="https://vimeo.com/843540328" rel="nofollow">https://vimeo.com/843540328</a>). The basic idea is that eclasses hold sets of operator expressions (think sea-of-node IR), and we keep that alongside the CFG with a "skeleton" of side-effecting ops. We build that, do rewrites, then extract out of it back to a conventional CFG-of-basic-blocks for lowering. The "equivalence" part comes in when doing rewrites: the main difference between an egraph and a conventional sea-of-nodes IR with rewrite rules is that one keeps all representations in the equivalence class around, then chooses the best one later.<p>We had to solve a few novel problems in working out how to handle control flow, and we're still polishing off some rough edges (search recent issues in the repo for egraphs); but we're mostly happy how it turned out!<p>(Disclosure: tech lead of CL for a while; the e-graphs optimizer is "my fault")</p>
]]></description><pubDate>Tue, 19 Mar 2024 03:02:14 +0000</pubDate><link>https://news.ycombinator.com/item?id=39752535</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=39752535</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=39752535</guid></item><item><title><![CDATA[New comment by cfallin in "Cranelift code generation comes to Rust"]]></title><description><![CDATA[
<p>We actually take a fairly unconventional approach to e-graphs: we have a few linear passes and we do all rewrites eagerly, so we use them to provide a general framework for the fixpoint problem into which we plug in all our rewrites, but we don't have the usual "apply as much CPU time as you want to get better results" property of conventional equality saturation.<p>I gave a talk about this approach, aegraphs (acyclic e-graphs), here: slides (<a href="https://cfallin.org/pubs/egraphs2023_aegraphs_slides.pdf" rel="nofollow">https://cfallin.org/pubs/egraphs2023_aegraphs_slides.pdf</a>), video (<a href="https://vimeo.com/843540328" rel="nofollow">https://vimeo.com/843540328</a>)<p>(disclosure: Cranelift tech lead 2020-2022 and main author of the e-graphs mid-end, as well as regalloc, isel and its custom DSL, and other bits, along with the excellent team)</p>
]]></description><pubDate>Tue, 19 Mar 2024 01:30:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=39752112</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=39752112</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=39752112</guid></item><item><title><![CDATA[New comment by cfallin in "Cranelift code generation comes to Rust"]]></title><description><![CDATA[
<p>Right, it's about algorithmic tradeoffs throughout. A good example I wrote about is here: <a href="https://cfallin.org/blog/2021/01/22/cranelift-isel-2/" rel="nofollow">https://cfallin.org/blog/2021/01/22/cranelift-isel-2/</a> where we use a single-pass algorithm to solve a problem that LLVM has a multi-part fixpoint loop to solve.<p>Most CPU time during compile is in the register allocator and I took a really careful approach to optimization when I rewrote it a few years ago (more details <a href="https://cfallin.org/blog/2022/06/09/cranelift-regalloc2/" rel="nofollow">https://cfallin.org/blog/2022/06/09/cranelift-regalloc2/</a>). We generally try to pay close attention to algorithmic efficiency and avoid altogether the fixpoint loops, etc that one often finds elsewhere. (RA2 does backtrack and have a worklist loop, though it's pretty minimal, and also we're planning to add a single-pass mode.)<p>(disclosure: I was Cranelift tech lead in 2020-2022)</p>
]]></description><pubDate>Tue, 19 Mar 2024 01:27:04 +0000</pubDate><link>https://news.ycombinator.com/item?id=39752098</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=39752098</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=39752098</guid></item><item><title><![CDATA[New comment by cfallin in "Cranelift code generation comes to Rust"]]></title><description><![CDATA[
<p>There are some benchmarks of Cranelift-based Wasm VMs (Wasmtime) vs. LLVM-based Wasm VMs here: <a href="https://00f.net/2023/01/04/webassembly-benchmark-2023/" rel="nofollow">https://00f.net/2023/01/04/webassembly-benchmark-2023/</a><p>The (perhaps slightly exaggerated but encouraging to me at least!) money quote there is:<p>> That’s right. The cranelift code generator has become as fast as LLVM. This is extremely impressive considering the fact that cranelift is a relatively young project, written from scratch by a very small (but obviously very talented) team.<p>In practice anywhere from 10%-30% slower maybe is reasonable to expect. Compiler microbenchmarks are interesting because they're very "quantized": for any particular benchmark, often either you get the right transforms and achieve <i>the</i> correct optimized inner loop, or you don't. So the game is about getting more and more cases right and we're slowly getting there.<p>(disclosure: I was tech lead of Cranelift in 2020-2022)</p>
]]></description><pubDate>Tue, 19 Mar 2024 01:23:36 +0000</pubDate><link>https://news.ycombinator.com/item?id=39752073</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=39752073</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=39752073</guid></item><item><title><![CDATA[Faster JavaScript on WebAssembly: Portable Baseline Interpreter and Future Plans]]></title><description><![CDATA[
<p>Article URL: <a href="https://cfallin.org/blog/2023/10/11/spidermonkey-pbl/">https://cfallin.org/blog/2023/10/11/spidermonkey-pbl/</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=37849310">https://news.ycombinator.com/item?id=37849310</a></p>
<p>Points: 4</p>
<p># Comments: 0</p>
]]></description><pubDate>Wed, 11 Oct 2023 19:42:22 +0000</pubDate><link>https://cfallin.org/blog/2023/10/11/spidermonkey-pbl/</link><dc:creator>cfallin</dc:creator><comments>https://news.ycombinator.com/item?id=37849310</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=37849310</guid></item></channel></rss>