Scalan: a reasonably typed meta programming framework in Scala
summary
Scalan provides a graph-based IR and lifted embedding on top of standard Scala (macros + compiler plugin) to turn Scala functions into staged graphs, run rewrite rules and emit generated C++ and Scala kernels. Demo builds matrix×vector in the Scalan DSL, visualizes/debugs graphs, and auto-eliminates abstractions via isomorphic specialization. Benchmarks show abstract execution ~3× slower (about 5s) while generated kernels run ≈100 ms; kernel generation takes a few seconds and results match standard evaluation.
AI-written summary · about
chapters (6)
- 0:00Start
- 5:22Basic Machinery Code Virtualization
- 7:45Basic Machinery: Standard Evaluation
- 16:16Basic Machinery:Representation of Lambdas
- 30:50Basic Machinery: Generic meta-operators
- 46:31Multi-stage Compilation Pipeline








