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 system.

We also know that type systems are hard: many computer scientists built their entire careers studying type systems. Yet we know rather little about type systems of main-stream languages. 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 attached to an instance of any class, you define it in a package, outside any class (we call it package-level functions):

But sometimes you need static constants in your class: for example, to comply with requirements of some framework or to use serialization. How do you do this in Kotlin? Continue reading

Posted in General, Language design | Tagged | 7 Comments

Type-Safe Web with Kotlin

We told you about Kara Web Framework a while ago. It is written in Kotlin and relies on type-safe builders. It doesn’t have to be the only web framework for Kotlin, but the general principles seem good, so I wrote an article about these principles: Type-Safe Web with Kotlin, it gives an overview of the framework design, and then gives many details about builders, extensions and so on. Continue reading

Posted in General | 1 Comment

Talk @ GeekOUT Tallinn: Language Design Trade-Offs (Kotlin and Beyond)

This week I’m speaking at GeekOUT Tallin, and my colleagues Mikhail Vink and Sergey Karashevich are holding a 15-minute DEMO on Thursday, telling you about cool stuff in JetBrains’ IDEs.

The topic of my talk is “Language Design Trade-Offs (Kotlin and Beyond)“, so one can summarize it as “why designing languages is SO interesting”.

Continue reading

Posted in General | 1 Comment

Kotlin M5.3: IntelliJ IDEA 13, Delegated Properties and more

Kotlin M5.3 brings support for IntelliJ IDEA 13 and some new features for you to check out. We are moving towards powerful runtime support, including reflection and other framework-enabling features. This milestone marks our first steps in that direction. Continue reading

Posted in General | Tagged | 28 Comments

Kotlin M5.2: IntelliJ IDEA 12.1 and Gradle

Another update of Kotlin comes out today. Welcome Kotlin M5.2.  Continue reading

Posted in General | Tagged | 7 Comments

The Dot Operator

Point-free style is a big trend in modern functional programming: it allows to manipulate functions without mentioning their arguments which makes the code concise and compositional. Here is an example from Wikipedia:

This function, written in Haskell, composes a map() function with a filter() function. As you can see, point-free style largely relies on dots.

Kotlin is not a functional language per se, but we are happy to borrow useful features from other languages. So, today I’ll write about dots. Continue reading

Posted in General | Tagged | 18 Comments

KAnnotator 0.1 is out

We announced KAnnotator back in December: it helps you against NPEs in Java and makes your Kotlin code nicer. Today we are pleased to announce a KAnnotator Plugin for IntelliJ, version 0.1. It is available from the plugin repository. Continue reading

Posted in General | Tagged | 13 Comments

Kotlin Session and JetBrains Booth at 33rd Degree Conference

JetBrains and Kotlin are participating in the 33rd Degree Conference in Warsaw, Poland. Join 1,200 attendees March 13-15 for 92 sessions from 58 speakers. Come by our booth and learn what’s new in Project Kotlin, as well as the upcoming IntelliJ IDEA 12.1 release. Be sure to mark your calendar for our two sessions with JetBrains Technical Evangelist Hadi Hariri.

Continue reading

Posted in General | Tagged | 1 Comment

Kotlin M5.1

There have been enough little improvements since Kotlin M5 so that we are rolling them out as M5.1 today. Some of them are not so little in fact, like enabling the use of Scala libraries, such as Akka. This post gives a quick overview of these changes. Continue reading

Posted in General | Tagged | 2 Comments