This episode explores the Kotlin ecosystem: the official kotlinx.coroutines, kotlinx.serialization, and Arrow libraries, using Kotlin with Reactor, Spring, and Android Jetpack, Kotlin scripting for CLI applications, and how to contribute to the Kotlin open-source ecosystem.

A great language is built by its ecosystem. Episode 18 explores the layer of libraries and tools around Kotlin: the kotlinx family, the functional Arrow library, integration with Reactor and Spring, Kotlin scripting for automation, and paths for contributing to open source.
Understanding the ecosystem doesn't mean memorizing every library — it means knowing what's available, when to use it, and how to integrate it. This skill separates developers who just write code from those who build systems.
After this episode, you'll have an ecosystem map for choosing libraries with confidence.
JetBrains' official libraries are available under the kotlinx name:
The kotlinx family follows Kotlin best practices and supports multiplatform. When in doubt, start here before looking for third-party libraries:
import kotlinx.coroutines.flow.flowOf
import kotlinx.serialization.json.Json
val json = Json.encodeToString(listOf(1, 2, 3))
val flow = flowOf(1, 2, 3)Json.encodeToString and flowOf come from two different kotlinx libraries yet integrate seamlessly. The consistent API design across kotlinx libraries makes the ecosystem easy to adopt.
Arrow brings type classes, Option, Either, IO, and functional effects to Kotlin:
import arrow.core.Option
import arrow.core.Some
import arrow.core.none
fun cari(kunci: String): Option<Int> =
if (kunci == "rahasia") Some(42) else none()
val hasil = cari("rahasia").getOrElse { 0 }Option models a value that may be absent in a clear way. Arrow suits codebases that emphasize functional composition and immutability — but consider its learning curve before adopting it across the whole team.
Reactor (Project Reactor) is the foundation of Spring WebFlux. Kotlin works seamlessly with it; coroutines even have the kotlinx-coroutines-reactive adapter:
import kotlinx.coroutines.reactor.asFlow
import reactor.core.publisher.Flux
val flow = Flux.just(1, 2, 3).asFlow().asFlow() turns a Flux into a Kotlin Flow, and asFlux() does the reverse. You can write reactive pipelines with Kotlin idioms while still using Reactor underneath.
Kotlin is a first-class citizen in Spring — since Spring 5, the whole framework supports Kotlin with dedicated DSLs and constructor-first APIs. In Android Jetpack, components like ViewModel, Room, and Navigation fully support Kotlin, with KSP for code generation (episode 16). Both ecosystems use modern Kotlin idioms such as data classes and coroutines.
Kotlin can be written as a .kts script for automation without a full project:
kotlin -script skrip.ktsA .kts script can include Maven dependencies with the @file:DependsOn annotation and run directly. This makes Kotlin practical for admin tasks, generators, and quick prototypes.
For serious CLIs, the Clikt and kotlinx-cli libraries help with argument parsing:
import kotlinx.cli.*
fun main(args: Array<String>) {
val parser = ArgParser("alat")
val nama by parser.option(ArgType.String, "nama", "Nama pengguna")
parser.parse(args)
println("Halo, $nama")
}ArgParser declares options declaratively, and parser.parse(args) handles the input. Kotlin CLIs produce JVM binaries that are easy to distribute or wrap in Docker.
The Kotlin ecosystem grows through contributions. Some beginner-friendly entry points:
git clone https://github.com/JetBrains/kotlinx.coroutines.git
git checkout -b fix-dokumentasi
git add .
git commit -m "docs: perbaiki contoh pemakaian Flow"The git clone, git checkout -b, and git commit commands above are the standard contribution workflow. Start with small, well-documented changes — consistency and courtesy in reviews are valued as highly as big code.
Episode 18 explored the Kotlin ecosystem: the official kotlinx family, the functional Arrow library, integration with Reactor and Spring, scripting for CLIs, and paths for contributing to open source.
The key takeaways:
.kts scripts and Clikt suit automation and CLIs.In episode 19 we'll discuss operational readiness and runbooks — operational runbooks for Kotlin applications, monitoring, logging, and error handling, deployment with containerization and CI/CD, and safe release management and rollbacks.