Efficient OCaml compilation with Flambda 2
summary
Flambda 2 is an IR plus an optimization pass for OCaml that replaces the old middle-ends and aims to match closure speed while producing fewer allocations; it builds a single big pass simplify that does inlining, aggressive unboxing many variants, and constant propagation together so transformations feed each other without expensive fixpoints. The IR is CPS-style with double-barrel CPS (normal and exception continuations), uses abstract interpretation plus SSA-like value propagation, and is tested enough to run in production though not upstream yet.
AI-written summary · about
chapters (14)
- 0:00Flambda 2 introduction
- 1:14Replacing older middle ends
- 2:21Pattern matching optimizations
- 4:32Single large optimization pass
- 7:26Inlining strategies
- 8:52Simplification pass and IR
- 10:39Optimizing the intermediate representation
- 12:03Forward pass and abstract interpretation
- 14:56Fix points and info accumulation
- 16:20Rebuilding expressions
- 18:05Performance optimizations
- 18:51Testing and production
- 19:57Language extensions and future
- 20:20Q&A
related talks
29mFlambda 2 Types: An abstract domain for static analysis of functional programs (mo...
19mFlambda2 Validator
15mDuplo: A Framework for OCaml Post-Link Optimisation
15mEfficient Compilation of Algebraic Effect Handlers
21mFlow-Analysis-Based Closure Optimization
23mBetter Defunctionalization through Lambda Set Specialization
12mCompiling Effect Handlers in Capability-Passing Style
01h 05mControl Flow Obfuscation for Featherweight Java + Efficient Fair Conjunction
