Skip to content
0:00 / 0:00

#kotlin#typeinference#typesystem

Designing Kotlin Beyond Type Inference | Ross Tate

Kotlin by JetBrains

100K subscribers • 61 videos on Hallway

YouTube
  • Recommended by 2 people: 1 on Lobsters and 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.

3.7K views1 year ago2 recommendations

Programming languagesComputer scienceKotlinLanguage design and type systemsCompilers and interpreters

Ross Tate explains how Kotlin's next-generation typing algorithms can determine program safety more efficiently than traditional type-inference algorithms.

Recording brought to you by American Express. americanexpress.io/kotlin-jobs Kotlin programmers regularly elide uninformative types from their programs. This makes Kotlin programs faster to develop, easier to read, and less effort to maintain. It also means the Kotlin language needs to be designed so that its compilers can reliably accept programs without these typing hints. We think of this as type-inference, but—by definition—type-inference means determining these missing types can be filled in such that the program type-checks. But what if we can determine a program is safe without determining these missing types? What if we can do so even when it such types do not exist? And what if we can do so more efficiently than any type-inference algorithm can? In researching Kotlin's next-generation typing algorithms, we have discovered we can efficiently exceed the capabilities of type-inference and type-checking. We have developed a type-"outference" algorithm that efficiently decides "type-consistency", which all type-inferable/checkable programs satisfy (but not vice versa). While type-inference still has its place in user feedback and compilation, type-consistency is a much more flexible property, and type-outference offers clear guidelines on how to design features for efficient validation. In this talk, after introducing these concepts, we will provide a behind-the-scenes look into how they guide the design of various expected and hypothetical features for Kotlin, such as union types for errors, conditional inheritance for type-safe equality with value types, and implicit polymorphism for non-escaping references.

Why it's here

2 people recommend this

What people say. Recommended by Kotlin team members as a deep dive into ongoing research on Kotlin's type system, union types, and conditional conformances.

Moments people linked to

snejon Lobsters • Recommends

Designing Kotlin Beyond Type Inference

u/mzarechenskiyKotlin-teamin r/Kotlin • Recommends

On “Kotlin Ecosystem AMA – December 11 (3–7 pm CET)”

On conditional conformances: this is ongoing research in the type system. You can check out the talk by Ross Tate, he briefly mentions it: [video This kind of feature requires some rework of our type system to make everything work correctly and still run in polynomial time
3View on Reddit

u/mzarechenskiyKotlin-teamin r/Kotlin • Recommends

On “Kotlin Ecosystem AMA – December 11 (3–7 pm CET)”

At the moment, we don't have a definite answer on whether we'll be able to pull unions off in a way that is convenient to use, integrates properly with all other Kotlin features, and still keeps the type system polynomial. We have ongoing research in this area by Ross Tate, here's his talk with potential improvements: [video