Ross Tate
Programming-Languages Researcher and Consultant
I am an independent researcher and consultant on programming-language design and implementation, currently working with the Kotlin language team. Before going independent, I was a professor at Cornell University, and I worked with the Kotlin team in its early days to integrate my research on mixed-site variance and gradual types into what became platform types. Beyond Kotlin, I have contributed to the designs of Java, Scala, Ceylon, Julia, and WebAssembly.
Revamping and Extending Kotlin's Type System
You might be surprised to learn that Kotlin's type system is undecidable and unsound; we can reliably cause the type-checker to stack-overflow, and we can trick it into thinking a String object is an Int. And that's before considering type inference or advanced features like platform types. Yet, understandably, developers are always requesting more features, like union and intersection types, and the Kotlin team would like to provide such features, but without jumping off a cliff of unrecoverable complexity. So how can we achieve this?
Kotlin is not alone in these issues; in fact, I discovered many of these problems in Java first. Yet, in discovering them, I also recognized how unnatural these problematic programs were. That is, they do not seem to be programs any pragmatic person would actually write. Rather, they represented expressiveness in the language that no one actually seems to need but yet manages to complicate the typing algorithms and even the language design.
Recently, the Kotlin team and I started to explore how we might remove the unnecessarily problematic expressiveness—in a way that no practical developer would ever notice—so that we can lay a better foundation for supporting the features the developers actually want. In this session, I will offer a sneak peek into the changes we are exploring: the pragmatic restrictions, the new algorithmic foundations, and the extensions like efficient unions and intersections we hope to add. While this is a long-term project, we hope this session will convey the design strategy we are pursuing, as well as provide an opportunity for developers to share feedback and insights that can help us ensure the improvements serve their needs over the coming years.