Project Valhalla promises to add virtual machine support for value classes and specialization in Java. However, the assumptions built into the low level specialization scheme are not compatible to all of the Scala programming language features, such as existentials and variance: there is a semantic gap between the Java specialization in Project Valhalla and the Scala programming language.

In this talk I will explain the inner working of the specialization in Project Valhalla, highlighting where the semantics in Java and Scala diverge. We will go through several language-level solutions to bridge this gap, each with its own trade-offs, finally converging towards a scheme that allows Scala to define new specialized classes and to interoperate with Java-defined ones.
With all facts on the table, we can look at the changes necessary in the Scala type system and the patterns that will become invalid. In doing so, we’ll be able to isolate what’s good about embracing Project Valhalla, what’s bad and what’s ugly: those patterns that will just have to go away. Expect to learn about reified types, bytecode transformations and their correspondence to high-level Scala code. Filmed at ScalaDays 2015.

Presentation: Project Valhalla – The Good, the Bad and the Ugly

About The Author
-