Free Variable as Effect, in Practice
summary
Proposes that treating free variables as algebraic effects gives practical wins: a tagless-final compiler prototype emits runnable wasm module and x86 code, performs on-the-fly variable-usage analysis and incremental error reporting, and avoids building full closures for open terms. The prototype compiles nested functions, runs in the browser, and already reports type and code-gen issues earlier than usual pipelines; memory/closure overhead is reduced in practice (promising but still under evaluation). Tools: tagless-final style, algebraic effects, wasm backend.
AI-written summary · about
chapters (7)
- 0:00Free variable effects
- 1:04Teaching compiler class
- 6:44Primitive variables and environments
- 12:22Free variable as effect
- 17:46Compiler demo with diagnostics
- 23:46Key insights and future work
- 26:13Q&A
related talks
15mEfficient Compilation of Algebraic Effect Handlers
15mLatent Effects for Reusable Language Components
09mCompilers for nothing, executables for free!
15mEffects as Capabilities: Effect Handlers and Lightweight Effect Polymorphism
22mType-Safe Code Generation With Algebraic Effects and Handlers
19mAssociated Effects: Flexible Abstractions for Effectful Programming
44mRethinking compilers with live coding
15mZero-Overhead Lexical Effect Handlers
