u/TechTalksWeeklyin r/Kotlin • Recommends
#typesystem#typeinference#uniontypes
Revamping and Extending Kotlin's Type System | Ross Tate
100K subscribers • 61 videos on Hallway
- Recommended by 1 person: 1 in engineering communities.
- Presented by Ross Tate
- Made by the vendor. The company whose product it covers made or sponsored it.
Advanced. Deep dive for people who know the field.
12K views2 years ago1 recommendation
Programming languagesComputer scienceKotlinLanguage design and type systemsCompilers and interpreters
Ross Tate explains the unsoundness and complexity of Kotlin's type system and proposes ways to safely extend it with union and intersection types.
Recording brought to you by American Express. americanexpress.io/kotlin-jobs Enjoyed this talk? Experience it live at KotlinConf 2025—the biggest in history! Grab your tickets now: kotl.in/kotlinconf25 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. #kotlinconf #kotlinWhy it's here
1 person recommends thisWhat people say. Included in a popular list of the best Kotlin talks of 2024.
u/Skaldebanein r/Kotlin • Mentions
On “The buauty of Kotlin's type system”
u/mzarechenskiyKotlin-teamin r/Kotlin • Mentions
On “Kotlin Ecosystem AMA – December 11 (3–7 pm CET)”
u/okarmazinin r/Kotlin • Mentions
On “Kotlin Roadmap Update: Find out what comes next for Kotlin”
u/Ceigeyin r/Kotlin • Mentions
On “The buauty of Kotlin's type system”