Login
You're viewing the functional.cafe public feed.
  • Oct 30, 2026, 6:09 PM

    @gfxstrand I don't see why they'd end up being similar algorithms, but there is a good chance the problem is just me not understanding enough Hans-Kristian's algorithm.

    💬 1🔄 0⭐ 0

Replies

  • Oct 30, 2026, 6:22 PM

    @giomasce I think Hans-Kristian's blog post does a better job of explaining the frustration than the algorithm. 😅 (Which makes for a fine blog post, too!) The Mesa one ends up making a lot of similar choices. We just don't use a switch.

    I think the biggest difference is how the algorithms reason about the CFG. The Mesa algorithm (and I think HK's as well) do so from more of a graph/dominance perspective while the blog post you linked seems to be reasoning more from structure and trying find it in the node mess.

    But that may also be me not understanding the stackifier algorithm.

    But at the end of the day, there are a lot of common principals:

    1. back-edges mean loops
    2. topological sort to order blocks and group them into which things might come next.
    3. If irreducible, add a dummy loop to sort it out.
    💬 0🔄 0⭐ 0