Post #2292278
2026-05-09 16:23 UTC
@zwarich@hachyderm.io had you seen https://arxiv.org/pdf/2604.09961 yet?
mlir has their "region" thing which lets you stuff a whole sub-CFG with references to the outer context into an operand, similar to ideas for "subfunctions" we had for SIL. a late pass to split out invocation functions for closures that survive inlining/DCE/etc. seems reasonable for ultimately targeting LLVM or WASM. but if you do pascal style nested funcs with chained activation records, you could probably lower that representation directly
Replies (1)
-
@zwarich@hachyderm.io 2026-05-09 20:45
@joe@f.duriansoftware.com Yeah, I saw that, as well as their first work in this direction (Thorin) and some of the intermediate steps. That seems reasonable for representing nested functions and the result of the generator CPS transform, but I was originally thinking about something that also lets you represent the untransformed code. That’s probably a waste of time if your only viable compilation model is to transform the CPS-transform the yield-handling loop.