Get the latest tech news

Multi-Stage Programming with Splice Variables


This is an interactive demonstration of the ICFP 2025 paper Multi-Stage Programming with Splice Variables by Tsung-Ju Chiang and Ningning Xie. What is multi-stage programming? It's a technique where programs generate other programs.

The let rec construct is naively implemented by substituting the definition, which may cause different behavior compared to OCaml when the right-hand side is not a lambda. Our type system automatically tracks both stage levels and variable dependencies, ensuring that all generated code is well-formed, properly scoped, and type-checks correctly. This kind of transformation would be error-prone to write manually, but our dependency tracking system handles all the variable scoping automatically, ensuring the result is always well-formed.

Get the Android app

Or read this on Hacker News