Inline Traits for Specialization
summary
Implementation of compile-time specialization for Scala 3 uses inline traits plus context-bound specialized type parameters to inline trait methods into subclasses and eliminate allocations and virtual dispatch, yielding zero-cost trait-based abstractions when combined with the Specialized type class. A working experimental compiler patch exists in Scala 3.10 experimental implementation from a Google Summer of Code project and aims for preview in Scala 3.12. The scheme generates per-primitive specialized subtraits and preserves boxed erased signatures for library compatibility.
AI-written summary · about
