![Past](/lp/10yearsofkotlin/static/past-hero-f3086cb543f40a41f71de3c1a10cb204.png)
![2011](/lp/10yearsofkotlin/static/955a7091c07d9905b78078a1d4c6c20b/cd9a8/2011.png)
Hello world
The first syntax prototype
Function types and literals
//Functions
fun f(p: Int) : String { return p.toString() }
//Function types
fun (p: Int) : String
fun (Int) : String
//Function literals
{ (p: Int) : String => p.toString()} {(p : Int) => p.toString() }
{p => p.toString()}
Higher-order functions
fun filter<T>(
c: Iterable<T>,
f: fun (T) : Boolean
): Iterable<T>
val list = list("a", "ab", "abc", "") filter(list, { s => s.length() < 3 })
![2012](/lp/10yearsofkotlin/static/f3816c59e876214588fe4ad9071a2f1f/54304/2012.png)
its first update
The Great Syntactic Shift:
- Namespace died: the namespace keyword was replaced by package.
- The Arrow lost weight: now we use a “thin arrow” (->) instead of a “thick arrow” (=>).
- Function types became more readable:
// before:
fun max(col: Collection<Int>, compare: fun(Int, Int): Int): Int
// after:
fun max(col: Collection<Int>, compare: (Int, Int) -> Int): Int
The first Kotlin web demo
![The first Kotlin web demo](/lp/10yearsofkotlin/static/bf481d6260e6d89c032b5c5183082f6d/f297c/first-web-demo.png)
We went open source!
Kotlin started running on Android
package com.example
import android.app.Activity
import android.os.Bundle
class HelloKotlin() : Activity() {
protected override fun onCreate(savedInstanceState: Bundle?) {
super<Activity>.onCreate(savedInstanceState)
setContentView(R.layout.main)
}
}
![2013](/lp/10yearsofkotlin/static/bea994e14c17fd7a4fde0370eb0954a4/ddba5/2013.png)
The first chunk of SAM-conversion
support appeared in Kotlin
New language features were added: delegated properties, callable references, static constants, and static fields
Delegated properties
class Delegate() {
fun get(thisRef: Any?, prop: PropertyMetadata): String {
return "$thisRef, thank you for delegating '${prop.name}' to me!"
}
fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {
println("$value has been assigned")
}
}
Callable references
fun isOdd(x: Int) = x % 2 != 0
val numbers = listOf(1, 2, 3)
println(numbers.filter(::isOdd)) // Prints [1, 3]
The Gradle
plugin was released
![2014](/lp/10yearsofkotlin/static/be7bc362b90d989c6b48f9de2232f0b3/6df23/2014.png)
Kotlinlang.org was launched
![Kotlinlang.org was launched](/lp/10yearsofkotlin/static/18e7aa985ae77e432f6290cd6b523f8e/94992/kotlinlang-launch.png)
New features were added to improve JavaScript interop
Support for the dynamic keyword was added for declaring types as dynamic.
native("$")
val jquery : dynamic = noImpl
jquery.getJSON(KotlinCommitsURL) { commits: dynamic ->
val commitsTable = jquery("#kotlin-commits")
commits.forEach { commit: dynamic ->
commitsTable.append("""
${commit.sha.substring(0, 6)}
${commit.commit.message}
""")
}
}
It became possible to inline JavaScript code with the help of the js function.
jquery.getJSON(KotlinCommitsURL) { commits ->
js("console.log('Calling JavaScript')")
val commitsTable = jquery("#kotlin-commits")
}
Language Injection support for Kotlin was added to IntelliJ IDEA. This change enabled proper highlighting inside of the js function.
![2015](/lp/10yearsofkotlin/static/afdd35263668f3ccf27f241a96f04cc1/126d4/2015.png)
New features dramatically improved the developer experience on various platforms: multiple constructors, companion objects, sealed classes, lateinit properties
Multiple constructors
class MyView : View {
constructor(context: Context, attrs: AttributeSet, defStyle: Int): super(context, attrs, defStyle) {
// ...
}
constructor(context: Context, attrs: AttributeSet) : this(context, attrs, 0) {}
}
Before the 1.0 release, we took the opportunity to tidy the language up a bit:
- Removed all the deprecations that had accumulated as our libraries evolved.
- Removed all the deprecations from the generated code.
- Got rid of some legacy bytecode peculiarities that were found during the beta.
- Moved some of the stdlib code around to better structure the packages there.
![2016](/lp/10yearsofkotlin/static/0981874206f9be5dc3a28a82c3c6e768/f61e8/2016.png)
Kotlin 1.0 Released: Pragmatic Language for the JVM and Android 🎉
Gradle
met Kotlin
We demoed the first milestone of using Kotlin for Gradle build scripts.
Coroutines first appeared
Coroutines is a traditional CS term for “program components that generalize subroutines for non-preemptive multitasking”.
fun main(args: Array<String>) {
val future = async<String> {
(1..5).map {
await (startLongAsyncOperation(it)) // suspend while the long method is running
}.joinToString(" ")
}
println(future.get())
}
The first Kotlin Night took place in San Francisco
![](/lp/10yearsofkotlin/static/ca1d544fcc0cf08024fc9d5e7ca9a1bb/f4338/kotlin-night-2016-1.jpg)
![](/lp/10yearsofkotlin/static/08ed088c770493e509b73414a700835c/1ff76/kotlin-night-2016-2.jpg)
![2017](/lp/10yearsofkotlin/static/cbf3c6b1c2b31ce2fbdfe746eca5aa92/e1256/2017.png)
Kotlin on Android became official
At the Google I/O keynote, the Android team announced first-class support for Kotlin.
![](/lp/10yearsofkotlin/static/kotlin-on-android-cover-47cb84a64141d578cbde940c01e080a9.jpg)
We launched our support program for Kotlin User Groups, and Kotlin Nights became a community-driven event series
![](/lp/10yearsofkotlin/static/759d924e455c286d3f851ca905b12829/a5dd6/kotlin-night-2017-1.jpg)
![](/lp/10yearsofkotlin/static/79d19b7368b0ac06aa6b5bf301514809/1b5ef/kotlin-night-2017-2.jpg)
Our first book about Kotlin came out
![First kotlin book](/lp/10yearsofkotlin/static/bbce5c4417867a24f8e0850d912aa83e/629bf/kotlin-in-action.png)
The first Technology Preview of Kotlin/Native appeared
This made it possible to run Kotlin without a virtual machine. Shortly after, code sharing became available.
The very first KotlinConf was held in San Francisco
![](/lp/10yearsofkotlin/static/b57465c5ff7f768e9dc508399655d901/1eb4c/kotlin-conf-sf-2017-1.jpg)
![2018](/lp/10yearsofkotlin/static/ae0ac729854fbee6f4b4c7055500de19/36b8f/2018.png)
Ktor 1.0 was released
Ktor is a Kotlin framework for building asynchronous servers and clients in connected systems. It takes full advantage of the language in order to provide a great developer experience and excellent runtime performance.
fun main() {
embeddedServer(Netty, port = 8000) {
routing {
get ("/") {
call.respondText("Hello, world!")
}
}
}.start(wait = true)
}
Inline classes made it possible to wrap a value of a type without creating an actual wrapper object
inline class Name(internal val value: String)
We made it possible to embed runnable and editable Kotlin snippets into blog posts and other materials
Adding an embedded Kotlin playground is as easy as writing a single line in the page header.
<script src="https://unpkg.com/kotlin-playground@1" data-selector="code"></script>
KotlinConf 2018 was held in Amsterdam
![](/lp/10yearsofkotlin/static/c791e19ec93e85211dd1adade1f07740/9268e/kotlin-conf-ams-2018-1.jpg)
![](/lp/10yearsofkotlin/static/085c062bec75064b10ed7e4dc57ef379/9268e/kotlin-conf-ams-2018-2.jpg)
![2019](/lp/10yearsofkotlin/static/8b86d73e2384bbd02eae0999485768b4/f61e8/2019.png)
We took the first steps in exploring Kotlin for Data Science
conda install kotlin-jupyter-kernel -c jetbrains
Android development became
Kotlin-first!
We kicked off Kotlin/Everywhere
A series of community-led events co-organized by JetBrains and Google.
![](/lp/10yearsofkotlin/static/da95804430649452025377ae8369ab97/3666c/kotlin-events-2019-1.jpg)
We implemented SAM conversions for Kotlin classes
fun interface Action {
fun run()
}
fun runAction(a: Action) = a.run()
fun main() {
runAction {
println("Hello, KotlinConf!")
}
}
The first ever Kotlin Heroes contest took place on Codeforces
KotlinConf 2019 was held in Copenhagen
![](/lp/10yearsofkotlin/static/bd3cb7e4771c634f01331108da76a1d0/99f8e/kotlin-conf-cpg-2019-1.jpg)
![2020](/lp/10yearsofkotlin/static/a58ba5a3645e2b39a0ff41f19b4ede58/426a0/2020.png)
Kotlin Multiplatform Mobile moved to Alpha
This signified the Kotlin team’s full commitment to improving this technology and helping it evolve. It was also a signal that the product would develop quickly.
![](/lp/10yearsofkotlin/static/1cece8474666f5ce9fd59bcf8b011b44/1066c/roman-elizarov.jpg)
Roman Elizarov became the new Project Lead for Kotlin, after Andrey Breslav stepped down
kotlinx.serialization 1.0 was released
import kotlinx.serialization.*
import kotlinx.serialization.json.*
@Serializable
data class User(val name: String, val yearOfBirth: Int)
fun main() {
// Serialization (Kotlin object to JSON string)
val data = User("Louis", 1901)
val string = Json.encodeToString(data)
println(string) // {"name":"Louis","yearOfBirth":1901}
// Deserialization (JSON string to Kotlin object)
val obj = Json.decodeFromString<User>(string)
println(obj) // User(name=Louis, yearOfBirth=1901)
}
A new release cadence was announced for Kotlin and the Kotlin plugin
Kotlin 1.X will be released every six months.
The “Atomic Kotlin” book was published
![Atomic kotlin book](/lp/10yearsofkotlin/static/ff695088aace822595c9ec3c8dbc174a/b10f2/atomic-kotlin.png)
What about you?
Try Kotlin now →
or share your #10yearsofkotlin
story and win a T-shirt