Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsApr 12, 2026·3 min de lectura

Kotlin — Modern Statically Typed Language for JVM and Beyond

Kotlin is a statically typed, general-purpose programming language developed by JetBrains. Runs on the JVM, Android, native, WebAssembly, and JS targets. Officially endorsed by Google as the preferred language for Android development.

Introducción

Kotlin is a statically typed, general-purpose programming language developed by JetBrains. Kotlin compiles to Java bytecode (JVM), JavaScript, WebAssembly, and native binaries. Officially endorsed by Google as a preferred language for Android development in 2017. Now the #1 language for new Android apps and widely used on the server (Spring Boot + Kotlin, Ktor) and multiplatform (Kotlin Multiplatform).

What Kotlin Does

  • Null safety — types distinguish nullable (String?) from non-null (String)
  • Data classes — auto-generate equals, hashCode, copy
  • Extension functions — add methods to existing classes
  • Coroutines — structured concurrency with suspend functions
  • Smart casts — compiler narrows types after checks
  • Type inference — minimal explicit typing
  • Functional — higher-order, lambdas, collections DSL
  • Multiplatform — share code across JVM, JS, Native, iOS, Android
  • Compose — Jetpack Compose (Android) and Compose Multiplatform (desktop/web/iOS)
  • Full Java interop — call Java from Kotlin and vice versa

Architecture

Kotlin compiler targets JVM bytecode by default (also JS, Native via LLVM, WASM). The Kotlin Multiplatform toolchain compiles shared code for multiple targets. Coroutines are implemented as a compiler transform + runtime library — no OS thread per coroutine.

Self-Hosting

Language toolchain.

Key Features

  • Null safety in the type system
  • Data classes
  • Extension functions
  • Coroutines (structured concurrency)
  • Higher-order functions and lambdas
  • Operator overloading
  • Sealed classes + when expressions
  • Kotlin Multiplatform
  • Jetpack Compose (Android UI)
  • Compose Multiplatform (desktop + iOS)
  • Gradle Kotlin DSL

Comparison

Language Target Null Safety Coroutines
Kotlin JVM/JS/Native Yes Yes
Java JVM Optional Project Loom
Scala JVM Option type Yes
Swift Native Yes async/await + actors
C# CLR Nullable ref types async/await
Go Native No Goroutines

FAQ

Q: Compared to Java? A: Kotlin is Java's improved version: null safety, data classes, lambdas, extension functions, coroutines, and less boilerplate. Most Java projects can gradually migrate to Kotlin, and the two languages can coexist in the same project.

Q: Must I use Kotlin for Android? A: Not required, but Google strongly recommends it. Since 2019, new APIs, official docs, and Android KTX are Kotlin-first.

Q: Is Compose Multiplatform mature? A: In 2024, Desktop and Android are stable, iOS is gradually stabilizing, and Web is still maturing. Usable for production but evaluate against your own needs.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados