The Kotlin Language: 1.0 Beta is Here!

We are extremely pleased to present Kotlin 1.0 Beta for JVM and Android!

To recap: Kotlin is a modern programming language that JetBrains has been working on for quite some time now.

This post gives an overview of where we are and what’s coming next. Changes in this version are listed here.

The story behind Kotlin

Kotlin was conceived in 2010. Ten years of Java development led us to feeling that our productivity at JetBrains could be improved significantly by using a modern JVM language alongside Java. Having evaluated other available options, we decided that a new language was needed there, and we had the expertise and resources to create such a language. Our primary line of business is making tools for developers, and the guiding principle is that the best way to make an awesome product for the users is to make an awesome tool we need ourselves. This worked with IntelliJ IDEA, ReSharper, and many other IDEs, as well as TeamCity and other server products, so we set off to apply the same principle for another developer tool — a programming language.

We designed Kotlin as a modern language for industry, and had rather specific requirements for it. First off, our projects live long and grow really big (many millions of lines of code), so we needed static typing to be able to reason precisely about huge codebases and maintain them over the years. Then, all our code was written in Java, so we needed a smooth migration path where the new language could be introduced gradually into an existing Java codebase affecting the rest of the code as little as possible. Also, being JetBrains, we did not want to compromise on the tooling quality: we were looking for a new language to make us more productive, and we believe that much of it depends on the tooling. Finally, we needed a language that’s easy to learn and understand: in our teams, we do not separate “library writers” from “library users”, and we want all our developers to be equally productive with the language they are using.

Such a project involves making very many decisions, and we knew from the start that it’s impossible to get everything right on the first try. That’s why we allowed a considerable period for experimenting and validation of the core design choices: as it was being used by early adopters both inside and outside JetBrains, we were constantly gathering feedback and making changes (many thanks to our community for all the comments you folks gave us!). This gave us important insights into a wide range of use cases, and now we believe that we can maintain backward compatibility after 1.0.

JetBrains has been using Kotlin in production of IntelliJ IDEA, YouTrack and other products for quite a long time now. We have more than 250’000 LOC of Kotlin in production at the moment (plus about as much in the Kotlin project itself). While some of our projects are entirely written in Kotlin (account.jetbrains.com), others have introduced it to existing Java codebases, as we planned initially. We reached the level of interoperability where freely putting Kotlin alongside Java is transparent for Java clients: Java can be called from Kotlin and vice versa, sources can be mixed in one project, resulting .class files are totally compatible with Java tooling.

Kotlin is serving us well and we have dedicated a team of over 20 people to its development.

Even though it has not reached 1.0 yet, other companies and individual developers are already using Kotlin in production from web-service back-ends to Android apps. We’ve got reports from Expedia, Prezi.com and many others (feel free to add your company to this list by submitting a PR).

The number of lines of Kotlin code in open repositories on GitHub has been growing exponentially so far (JetBrains’ projects are excluded):

What Kotlin feels like

From our own experience with the language and from what we hear from many external users here’s what using Kotlin feels like:

it’s less code,

better readability,

more type-safety,

more expressive power,

smooth experience with tooling and interop.

What is Beta?

While being actively used in production, Kotlin is in the Beta status now. What it means to you:

we are wrapping up the preparations to the official release;

the binary format is finalized;

all major language changes have been done.

Compatibility

Kotlin won’t stay long in Beta, 1.0 is coming rather soon.

We are committed to smooth user experiences, and this includes compatibility of Kotlin versions. After 1.0 all updates to the language and libraries will be backwards-compatible:

a newer compiler will work with older binaries (but older compilers may not understand newer binaries, like javac 1.6 can’t read classes compiled by javac 1.8);

Frameworks, interop and migration

Virtually any Java or Android framework or library works smoothly with Kotlin. Among others, this includes Spring MVC, Vaadin, Vert.x and Jackson. Many Android frameworks require annotation processing that is available in Kotlin through kapt that supports Dagger 2, DataBinding, DBFlow, ButterKnife, AndroidAnnotations and others.

I’ll try to inquire into it, but I don’t think so. Previous Kotlin version 1.0.0-beta-1038 didn’t work with both Android SDK (16 and 19) current version doesn’t work only with Android SDK 16 in my case.

In my opinion, as a Scala dev, Kotlin is not a competitor for Scala, but it beats Scala in Android development. Android needs modern programming language which easy add to current project and easy start working with. Maybe Kotlin is the language that Android devs are waiting for? =)

There’s nothing wrong with Scala. Scala is a great language with its own set of unique qualities, in particular, a lot of power in the hands of library writers.

Why it didn’t meet our requirements:

the language and library design are heavily dependent on implicit parameters, which makes understanding code rather challenging in many cases; we see it as a maintainability issue for a big codebase,

there are many other features that make the language, although very powerful, very demanding of the user, and we do not believe in the idea of restricting ourselves to using only a severely restricted subset of the language in our projects,

these features also make tooling a real challenge, that is still open today in many respects (despite our own efforts and considerable advancements in this area),

Scala’s approach to the interop (for example, having their own incompatible collections library) is problematic when it comes to mixing Scala into a big Java codebase.

The JavaScript support remains experimental for now and will have its own release later on.

I would be super happy to write web apps in Kotlin front and back. How committed are you guys to maintaining JS support long term? Is it considered one of Kotlin’s primary features, or more like a side project with no definite future?