One of the reasons Kotlin has proven so popular is its wide array of abstractions and constructs. But pattern matching, a popular feature that in other languages allows us to easily inspect data and act accordingly, is currently missing.
This talk aims to explore the possibility of adding pattern matching to Kotlin. It will go through why and how it could be done, from adding it to the actual language to using a compiler plugin (much like kotlinx.serialization works).
This talk addresses:
- Why would Kotlin benefit from pattern matching?
- How do other languages compare?
- If we added it to the language, what could it look like?
- Can we ‘make it’, without baking it into the language?