Blazing-Fast Lambda Calculus via Metaprogramming
summary
An interpreter for a tiny UPLC subset is replaced by a JIT that uses multi-stage metaprogramming and Scala staging to generate JVM lambdas at load time, turning lambdas into real function calls and mapping built-ins to primitives. Benchmarks on 89 Plutus scripts show median ~4x speedup versus a tuned Haskell CEK implementation (some cases up to 9x, one microbenchmark 33x); compile time falls from ~22s to <2s after fixing AST splicing, and correctness needs preserved evaluation order, lazy cases, and budgeting.
AI-written summary · about
chapters (10)
- 0:00The problem of performance
- 2:53Lambda calculus in Cardano
- 6:24Reference CEK machine
- 8:46Benchmarking and optimization
- 10:06Tier 1 and staging approach
- 13:46Staged compiler implementation
- 17:08Performance demo results
- 18:46Addressing consensus bugs
- 21:14Optimizing compilation time
- 23:32Conclusion and use cases
