ScaIR: Type-safe Compiler Framework Compatible with MLIR
summary
ScaIR is a Scala-based reimplementation of MLIR that embeds compile-time typed operations into case classes, derives companion typeclasses via Scala 3 quotes and deferred, and offers a structure/destructure + mutable escape hatch to interoperate with MLIR’s generic form. The team builds a full IR, pattern-based rewrites as plain Scala pattern matching, and runs two benchmarks: random constant-folding and predictable chaining. Results show JVM JIT can match or approach C++ MLIR for large workloads, Scala Native lags, and end-to-end throughput is currently slower (up to an order of magnitude) but improving.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 0:22Compiler infrastructure and MLIR
- 1:47ScaIR goals and components
- 3:59MLIR example and tablegen
- 9:21MLIR learning curve
- 10:47ScaIR design and benefits
- 13:37MLIR vs ScaIR
- 17:04Implementation and benchmarks
- 19:35Takeaways and future
- 20:39Q&A
related talks
57mScalan: a reasonably typed meta programming framework in Scala
35mA Deep Dive into Scala Native Internals
21mReasonable Scala Compiler
01h 01mTypesafe Scala, Typelevel Scala – What’s Going On, Anyway?
01h 02mSimply Scala
49mCode Without Fear: Scala 3 and Iron, the Heroes of Reliability in Functional Programming
23mA Type Inferencer for ML in 200 Lines of Scala
49mType level Programming in Scala
