Est. 2011 Beginner

Kotlin

A modern, concise programming language that runs on the JVM, Android, and compiles to JavaScript or native code.

Created by JetBrains

Paradigm Multi-paradigm: Object-Oriented, Functional
Typing Static, Strong, Inferred
First Appeared 2011
Latest Version Kotlin 2.0 (2024)

Kotlin is a modern, pragmatic programming language developed by JetBrains. Designed to be fully interoperable with Java while being more concise and safer, Kotlin has become the preferred language for Android development and is increasingly popular for server-side applications.

History & Origins

Kotlin was born from JetBrains’ real-world experience. As the creators of IntelliJ IDEA and other developer tools, JetBrains engineers worked extensively with Java and understood its pain points intimately.

In 2010, JetBrains began developing a new language to address Java’s verbosity while maintaining full compatibility with the existing JVM ecosystem. The language was named after Kotlin Island near St. Petersburg, Russia, where many JetBrains developers are based—a nod to Java being named after the Indonesian island.

The Problem Kotlin Solves

Java, despite its maturity and ecosystem, has notable frustrations:

  • Verbosity: Getters, setters, equals(), hashCode(), toString() boilerplate
  • Null pointer exceptions: The “billion dollar mistake” in software
  • Limited type inference: Explicit types everywhere
  • No modern features: Lambdas came late, pattern matching still limited

Kotlin addresses these directly:

  • Concise syntax: Data classes, property syntax, smart casts
  • Null safety: Nullable types are explicit, checked at compile time
  • Type inference: val name = "Kotlin" instead of String name = "Kotlin"
  • Modern features: Lambdas, extension functions, coroutines, sealed classes

Rise to Prominence

Kotlin’s trajectory changed dramatically in 2017 when Google announced official support for Kotlin on Android at Google I/O. By 2019, Google declared Kotlin the preferred language for Android development.

This endorsement was transformative:

  • New Android documentation is Kotlin-first
  • Official samples and codelabs use Kotlin
  • Jetpack libraries are designed with Kotlin in mind
  • Jetpack Compose (modern Android UI) is Kotlin-only

Why Kotlin Succeeded

  1. 100% Java interoperability: Call Java from Kotlin and vice versa, use existing libraries
  2. Gradual adoption: Convert file by file, not all at once
  3. Google’s endorsement: Official Android support legitimized the language
  4. JetBrains backing: Created by tooling experts, excellent IDE support
  5. Pragmatic design: Focused on solving real problems, not academic purity
  6. Null safety: Eliminates entire categories of bugs at compile time

Kotlin Multiplatform

Beyond the JVM, Kotlin now targets multiple platforms:

  • Kotlin/JVM: Server-side, Android, desktop applications
  • Kotlin/JS: Compile to JavaScript for web development
  • Kotlin/Native: Compile to native binaries (iOS, embedded, WebAssembly)
  • Kotlin Multiplatform: Share code across platforms while keeping native UIs

Kotlin Multiplatform Mobile (KMM) allows sharing business logic between Android and iOS apps while writing platform-specific UI code.

Modern Kotlin

Kotlin 2.0 (2024) brought the new K2 compiler:

  • Faster compilation: Up to 2x speed improvement
  • Better IDE support: Faster code analysis and completion
  • Foundation for future features: Enables language evolution

Key language features:

  • Coroutines: Lightweight concurrency without callback hell
  • Sealed classes/interfaces: Exhaustive when expressions
  • Inline classes: Zero-overhead type wrappers
  • Extension functions: Add methods to existing classes
  • DSL capabilities: Build type-safe domain-specific languages

Kotlin vs. Java

FeatureKotlinJava
Null safetyBuilt-in, compile-timeOptional types (added in Java 8+)
Data classesOne lineDozens of lines (or records in Java 16+)
Type inferenceExtensiveLimited (var in Java 10+)
Extension functionsYesNo
CoroutinesNative supportProject Loom (preview)
Default argumentsYesNo (overloads needed)
Smart castsYesLimited (Java 16+ patterns)

Java has been catching up with records, pattern matching, and virtual threads, but Kotlin remains more concise and expressive for most use cases.

The Kotlin Community

Kotlin has a welcoming, pragmatic community focused on solving real problems. JetBrains actively engages through:

  • KotlinConf: Annual conference
  • Kotlin Slack: Active community discussion
  • KEEP: Kotlin Evolution and Enhancement Process

The language continues to evolve based on community feedback while maintaining backward compatibility.

Timeline

2011
JetBrains announces Kotlin project
2012
Kotlin open-sourced under Apache 2 license
2016
Kotlin 1.0 released with stability guarantee
2017
Google announces first-class Android support for Kotlin
2019
Kotlin becomes Google's preferred language for Android
2020
Kotlin 1.4 with new JVM IR backend
2021
Kotlin 1.5 adds sealed interfaces, inline classes stable
2022
Kotlin 1.7 with K2 compiler preview
2023
Kotlin 1.9 with K2 compiler beta
2024
Kotlin 2.0 with stable K2 compiler

Notable Uses & Legacy

Android Development

Google's preferred language for Android. Most new Android apps and all official samples are written in Kotlin.

JetBrains IDEs

IntelliJ IDEA, Android Studio, and other JetBrains tools are increasingly written in Kotlin.

Spring Framework

Spring Boot has first-class Kotlin support, with dedicated DSLs and extensions.

Gradle Build Tool

Gradle's modern build scripts use Kotlin DSL (build.gradle.kts) as the recommended approach.

Pinterest

One of the first major apps to adopt Kotlin, converting their Android codebase.

Netflix

Uses Kotlin for Android development and some server-side applications.

Language Influence

Influenced By

Java Scala Groovy C# Gosu Swift

Influenced

Swift (partially)

Running Today

Run examples using the official Docker image:

docker pull zenika/kotlin:1.4

Example usage:

docker run --rm -v $(pwd):/app -w /app zenika/kotlin:1.4 sh -c 'kotlinc Hello.kt -include-runtime -d hello.jar && java -jar hello.jar'

Topics Covered

Last updated: