TASTyTruffle: Just-in-Time Specialization of Parametric Polymorphism
summary
TASTyTruffle interprets Scala TASTy (not JVM bytecode), reifies generic types as runtime shapes and implements heterogeneous box-free representations so primitives avoid boxing. It uses the Truffle framework and Graal-style JIT to perform dynamic specialization, duplicating generic code per observed type combinations to produce monomorphic copies that JITs optimize. On a suite of benchmarks it ties JVM for monomorphic workloads and consistently outperforms the JVM on polymorphic workloads; artifacts and evaluation data are available.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 0:24Generics performance with type erasure
- 1:28Monomorphisation vs type erasure
- 3:56Scala compilation and TASTy
- 5:21TASTyTruffle architecture
- 6:25Rification of generic types
- 7:28Array access with rified types
- 8:30Polymorphic code performance
- 10:16Dynamic specialization for generics
- 11:42Benchmark results
- 12:44TASTyTruffle vs JVM generics
- 14:51Recap and conclusion
- 15:17Q&A
related talks
53mUnveiling the Mysteries of GraalVM's Least Understood Component
45mFuture proofing Scala the TASTY intermediate rep
28mTruffle
40mJoy of Meta-Tracing Just-in-Time Compilation: More Than Just a VM Generator
59mSupercompilation, Partial Evaluation, Futamura Projections and How GraalVM Will Save the World
42mPolymorphic Function Types in Scala 3
40mPolymorphic Function Types in Scala 3
43mAdding kind-polymorphism to the Scala programming language
