Kotlin

term

programming

Kept in this browser · My desk

JetBrains' statically typed language for the Java Virtual Machine, unveiled in July 2011, released as 1.0 in February 2016 and officially supported on Android since 17 May 2017.

JetBrains announced it at the Java Virtual Machine (JVM) Language Summit as a language "productive enough for today's environment and at the same time simple enough", building first-class integrated development environment (IDE) support in parallel.

What it is. Kotlin is an open-source, statically typed language developed by JetBrains that targets the Java Virtual Machine (JVM), Android, JavaScript, WebAssembly and native code. Its frequently asked questions page says the project started in 2010, was open source from very early on, reached its first official release, 1.0, in February 2016, and is developed under the Apache 2.0 licence. Version 1.0 was announced by Andrey Breslav, who described a pragmatic language for the JVM and Android that combines object-oriented and functional features and is focused on interoperability, safety, clarity and tooling support, and said JetBrains had been using it in real projects for the previous two years.

How it works. On the JVM the compiler produces Java-compatible bytecode, by default for Java 8, with newer targets from Java 9 to 26 available as an option. Kotlin runs on the JVM alongside existing Java code, which is possible because the JVM knows only class files, not the Java language, and JetBrains calls it 100 per cent interoperable with Java in both directions: Kotlin calls Java libraries and Java calls Kotlin. For browsers it emits JavaScript for the ECMAScript 5, 2015 or 2020 editions, and Kotlin/Native compiles to machine code that runs without a virtual machine.

Null safety. The feature most programmers notice first is in the type system. The documentation presents null safety as a way to reduce the risk of null references, "The Billion-Dollar Mistake": a variable of type String cannot hold null, while one declared String? can, and on a nullable value the compiler allows only safe calls through ?. or calls asserted non-null with !!. The Elvis operator, ?:, supplies a default when the value is null. A Java NullPointerException (NPE) thus becomes, in most Kotlin code, a compile-time error instead of a crash.

Origin. JetBrains unveiled Kotlin in July 2011 at the JVM Language Summit, building first-class integrated development environment (IDE) support in parallel with the language, since it is a tools company. Google announced official support on Android on 17 May 2017, together with a collaboration with JetBrains to move Kotlin into a non-profit foundation, and at Google I/O 2019 declared Android development "Kotlin-first".

Governance and releases. Android's developer site says Google co-founded the Kotlin Foundation; the foundation's own site gives its goals as financial support for ecosystem projects, control of incompatible changes to the language and preservation of the Kotlin trademarks, and reports, as its own figures, 2.5 million developers writing Kotlin regularly, 1.65 million GitHub repositories using it as their primary language and more than 400 universities teaching it. Since Kotlin 2.0.0, released on 21 May 2024 with the K2 compiler made stable, JetBrains ships a language release (2.x.0) every six months, a tooling release (2.x.20) three months after it, and bug-fix releases without a fixed schedule: 2.3.0 came on 16 December 2025, 2.4.0 on 3 June 2026, 2.4.20 on 7 September 2026 and 2.4.21 on 8 October 2026, with 2.5.0 planned for December 2026. From 2.4.0 the standard library for the JVM has an 18-month support window for each release line.

In practice. Google recommends starting new Android apps in Kotlin, and its developer site pairs the language with Compose for user interfaces and the Jetpack libraries. On the JVM the main build tools are Gradle and Maven; IntelliJ IDEA and Android Studio support the language out of the box, and Kotlin Multiplatform shares code between Android, iOS, the server and the web.

What goes wrong. The guarantee ends at the Java boundary. The documentation lists the ways an NPE can still happen in Kotlin: an explicit throw of NullPointerException, the !! operator, access to a member of a null reference of a platform type, which is a type coming from Java code whose nullability Kotlin cannot know, and generic types filled from Java, such as Java code adding null to a Kotlin mutable list of non-null strings. Code that mixes Kotlin and Java libraries therefore needs the same null checks at the seams as plain Java does.

Neighbours. Java, the language Kotlin was designed to interoperate with and in practice to replace on Android; bytecode, the class-file format both compile to; jit-compilation, which the JVM applies to them at run time; the type-system ideas of nullable types it shares with Swift; and JavaScript, one of its compilation targets.

Also known as: kotlin language

Sources

← Back to K Back to the glossary