An introduction to Kotlin by example
summary
Live coding shows Kotlin compiling to JVM and JavaScript, with examples that actually run: a Hello World, a recursive factorial that overflows Int so switches to java.math.BigDecimal and then becomes tail-recursive with tailrec to avoid stack overflow, and a data‑munging kata using Kotlin IO, lambda collections and extension functions to parse files into data classes and run unit tests. Demonstrations expose practical gotchas: no checked exceptions, map.withDefault behaving unexpectedly, nullable types and smart casts, and one puzzler that crashes the compiler in 1.1.
AI-written summary · about
