Kotlin is a general-purpose programming language that is
- cross-platform,
- statically typed
- concise (using type inference)
- Android native development
- 2019: Google endorsed as preferred language for Android app development
- Cross-platform mobile development
- "Write the business logic for your iOS and Android apps with less time and effort – using nothing but Kotlin" Jetbrains
- Cross-platform library development
- Kotlin/Native uses LLVM to compile Kotlin to static or dynamic native libraries for many platforms.
- iOS, macOS, Android, Windows, Linux, WebAssembly
- Server-side development
- Kotlin is JVM compatible so it can be used on top of Java web service frameworks like Spring
- Javascript front-end development
- Kotlin/JS transpiles to optimally-sized, readable Javascript.
- Statically-typed interfaces to reference DOM elements and WebGL
- Server-side interfaces to integrate with Node.js
- Dukat assists with conversion of TypeScript definitions to Kotlin/JS
- Writing for React with Kotlin
- Declarative UI for Android apps: Jetpack Compose
- as of this writing,latest version is 0.1.0-dev16 self-described as evolving with API breaking changes expected
fun main() {
println("Hello, world!!!")
print(factorial(10))
}
fun factorial(i: Int): Int {
return if (i == 0 || i == 1) { i } else { i * factorial(i-1) }
}
Hello, world!!!
3628800
Some important things to know:
- Kotlin Playground
- Interactive Exercises: Kotlin Koans
- Kotlin Evolution Proposals KEEP
- Many Android/Kotlin code tutorials and video walkthroughs at raywenderlich.com