Kotlin

Apache-2.0
Platform
Linux Windows macOS
Licence
Apache-2.0 Open source
Kotlin

Overview

Kotlin is a statically typed, general-purpose programming language from JetBrains, released under the Apache 2.0 licence. JetBrains announced it in 2011, shipped version 1.0 in February 2016, and has developed it as an open source project on GitHub since. The language compiles to JVM bytecode, JavaScript, self-contained native binaries through LLVM, and WebAssembly, and it runs alongside Java code in the same project with no wrappers or adapters. Google made Kotlin a first-class language for Android in 2017 and the recommended one in 2019, which turned a JVM-side project into the default choice for most new Android applications. The current stable release is 2.4.21, with 2.5.0 scheduled for December 2026.

Key Features

  • Null safety built into the type system — a nullable type is a different type, so the compiler catches a dereference before it becomes a NullPointerException.
  • Seamless Java interoperability — call Java libraries directly, implement Java interfaces, and mix Kotlin and Java sources in one module; the whole Java ecosystem, Spring and JUnit included, is available as is.
  • Coroutines — structured concurrency from kotlinx.coroutines: suspending functions, channels and flows express asynchronous code as ordinary sequential code.
  • Kotlin Multiplatform — one codebase compiles to Android, iOS, JVM servers, desktop and web, sharing business logic while keeping native UI where it belongs.
  • Concise data modelling — data classes, sealed classes and interfaces, value classes and exhaustive when expressions replace pages of boilerplate while the compiler still checks exhaustiveness.
  • Extension functions and type-safe DSLs — add behaviour to existing types without inheritance, which is what makes libraries such as Ktor and Compose read like configuration rather than calls.
  • The K2 compiler — the rewritten frontend became the default with Kotlin 2.0 and is the base for faster compilation and IDE analysis.
  • Tooling across the lifecycle — Gradle and Maven plugins, first-class IntelliJ IDEA and Android Studio support, kotlinx.serialization for JSON, ktlint and detekt for style and static analysis, and Compose Multiplatform for shared UI.

Why Use Kotlin?

Kotlin fixes the parts of Java that cost the most in maintenance without giving up the platform. Nullability is part of the type, so a whole class of runtime crashes disappears at compile time; collections, properties and data classes remove boilerplate that used to be generated by hand or by annotation processors; and coroutines replace callback chains with code that reads top to bottom. Because it targets the JVM, the migration path is incremental: a single file in an existing Java project can be Kotlin, both directions of interop work, and the mature libraries, profiling tools and deployment patterns carry over unchanged. Tooling is the other half of the argument — JetBrains builds the language and the IDE that analyses it, Gradle support is first-party, and Android Studio ships with Kotlin as the default template. For teams that want one language for an Android app, its backend and a shared module between them, Kotlin Multiplatform is the shortest route there.

Use Cases

  • Android applications, including Compose-based UI.
  • JVM backends and microservices built with Ktor or Spring Boot.
  • Shared business logic across Android, iOS, web and desktop with Kotlin Multiplatform.
  • Desktop applications with Compose Multiplatform.
  • Native command-line tools and utilities compiled with Kotlin/Native.
  • Browser and Node.js code through Kotlin/JS.
  • Build scripts (build.gradle.kts) and automation scripts run with kotlinc -script.

Getting Started

The quickest install is SDKMAN (sdk install kotlin) or Homebrew (brew install kotlin); the stand-alone compiler archive from the release page unpacks to a kotlinc you can put on the PATH, and IntelliJ IDEA and Android Studio bundle it already. Verify the install with kotlinc -version, write a file containing fun main() { println("Hello, Kotlin") }, and compile it with kotlinc hello.kt -include-runtime -d hello.jar; for anything larger, use the Kotlin Gradle plugin, which handles dependency resolution and multiplatform targets. The official documentation at kotlinlang.org covers the language tour, the coroutines guide and the multiplatform handbook. Version 2.4.21 is current, 2.5.0 is planned for December 2026, and the compiler, standard library and tooling are all Apache 2.0.

Explore More Categories

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.