Master’s Thesis Presentation • Programming Languages • Reified Generic Types for Scala 3 on the JVM

Wednesday, August 12, 2026 1:00 pm - 2:00 pm EDT (GMT -04:00)

Please note: This master’s thesis presentation will take place in DC 2314 and online.

Jin Xu, Master’s candidate
David R. Cheriton School of Computer Science

Supervisor: Professor Ondřej Lhoták

Scala implements parametric polymorphism on the Java Virtual Machine primarily through type erasure. As a result, generic type arguments are normally unavailable during execution, and primitive values passed through generic code are represented using boxed object references. This limits the information available to the virtual machine and prevents generic values from consistently using unboxed forms.

This thesis presents an extension to the Scala 3 compiler that preserves generic type information and communicates it to a reification-aware JVM. The compiler inserts lightweight runtime reified type values for method and class type parameters and propagates them through the Scala compiler intermediate representation. It also emits custom JVM classfile attributes that describe how erased method parameters, return values, fields, method invocations, and object allocations relate to the corresponding reified type values. Together, these runtime values and static hints define a reified unboxed semantics while retaining ordinary JVM bytecode as the underlying executable representation.

The implementation modifies the Scala 3 compiler and integrates reification with its existing transformation and bytecode generation pipeline. It is evaluated using focused generic benchmarks and by recompiling the Scala standard library. The modified compiler successfully compiles the standard library. Of the 2058 standard library tests, 2033 pass, for a pass rate of 98.7%. The remaining failures are primarily caused by structural changes introduced by reification.

These results demonstrate that generic type information can be preserved through the production Scala compiler and encoded at the JVM bytecode level at the scale of a realistic Scala codebase. The work establishes the compiler-side foundation for future evaluation and optimization in a reification-aware JVM.


To attend this masters thesis presentation in person, please go to DC 2314. You can also attend virtually on Zoom.