Category Archives: Language design

Mixed-Site Variance in Kotlin

Type systems… We all know they are cool. In a static language, like Kotlin, the type system is the one responsible for early detection of errors. Many tools (e.g. an IDE with its refactoring abilities) also rely on the type … Continue reading

Posted in General, Language design | Tagged | 16 Comments

“Static constants” in Kotlin

Kotlin is designed so that there’s no such thing as a “static member” in a class. If you have a function in a class, it can only¬†be called on instances of this class. If you need something that is not … Continue reading

Posted in General, Language design | Tagged | 7 Comments

Ranges Reloaded

In Kotlin M5 we have redesigned our ranges a little bit.

Posted in General, Language design | Tagged | 11 Comments

How do you traverse a map?

It’s been a while since I blogged last time on Kotlin M2. Now, the hot summer has passed, and M3 will be out very soon. In this post I describe two small features added in M3 that make our lives … Continue reading

Posted in General, Language design | Tagged | 42 Comments

The Great Syntactic Shift

As the first public preview of Kotlin is approaching (it will be announced on Jan 10th, 2012, which is less than a week from now!), we are putting some things in order… In particular, we have reviewed syntactic forms available … Continue reading

Posted in General, Language design | Tagged | 47 Comments

DSLs in Kotlin: Part 1. What’s in the toolbox + Builders

If you have a very nice API, it is the fashion nowadays to call it an internal DSL, because the code that uses such an API reads almost like a language inside your language of choice. Fluent interfaces serve as … Continue reading

Posted in General, Language design | Tagged | 25 Comments

Multiple Inheritance Part 2: Possible directions

In the previous post in this series we discussed the disadvantages of the inheritance model we initially planned for Kotlin. Today we will talk about alternative designs. Note that these posts are intended to provoke a discussion, so that we … Continue reading

Posted in General, Language design | Tagged | 57 Comments

Multiple Inheritance Part 1: Problems with the existing design

I’m back from my vacation, and it’s time to get to one one the biggest issues pointed out in the feedback we received during conference presentations and in the comments to the docs. I’m talking about inheritance. I plan to … Continue reading

Posted in General, Language design | Tagged | 17 Comments