SlideShare a Scribd company logo
Kotlin: The Language of The
Future For JVM?
Leonardo Zanivan @ JavaOne Latin America 2016 [SES12196]
Who am I?
➔ Leonardo Zanivan
◆ Software Architect
◆ OSS Contributor
◆ GUJavaSC Member
◆ JCP Member
First things first
➔ Why Kotlin?
◆ Concise
◆ Safe
◆ Versatile
◆ Interoperabile
◆ Tooling
First things first
➔ History
◆ Conceived in 2010
◆ Language and compiler are open source (Apache 2)
◆ To be a modern industry standard language
◆ With static typing and a smooth migration path
First things first
➔ Why should I care?
◆ Enterprise class support
◆ Production ready
◆ Java #1 language
◆ Productivity
First things first
➔ Who is using?
◆ GMC
◆ Expedia
◆ Prezi.com
◆ Telegram
◆ 99 Taxis
◆ JetBrains (IDEA, YouTrack, TeamCity)
Easy to learn
➔ Extensive documentation
◆ Online reference http://kotlinlang.org/docs
◆ Online editor & training http://try.kotlinlang.org
◆ Language documentation (PDF with 153 pages)
◆ Books (Kotlin in Action and Kotlin for Android)
◆ GitHub and StackOverflow activity
Easy to learn
➔ Fast startup
◆ Intuitive, easy to read & write (opposed to Scala)
◆ No force Functional or OOP styling
Easy to learn
Online editor & training http://try.kotlinlang.org
Easy to use
➔ Tooling support
◆ IDEA Community & Ultimate
◆ Android Studio
◆ Eclipse
◆ Maven / Ant / Gradle
◆ NetBeans plugin (experimental)
◆ Sonar plugin (experimental)
Multi target support
➔ Java
➔ Android *
➔ JavaScript (experimental)
Easy to migrate
➔ Mix Java and Kotlin source files in the same project
➔ Java to Kotlin source conversion tool
➔ Compatible with Java 6 bytecode (100% compatible)
➔ Integrate with existing Java frameworks
➔ No runtime overhead
➔ No cost to adopt
KDoc
➔ Dokka is the documentation engine for Kotlin.
Feature: Null safety out-of-the-box
val givenName: String? = null
val len = givenName?.length //assign null
val len = givenName!!.length //assert null
Feature: Lean syntax (no get/set)
data class Book(var title: String, var author: Author)
val book = Book(“Kotlin at JavaOne”,”Leonardo”)
println(book.title)
Feature: Smart casts and type inference
if (node is Leaf) {
return node.symbol;
}
val myString = "Some text"
Functional programming
val numbers = arrayListOf(-42, 17, 13, -9, 12)
val nonNegative = numbers.filter { it >= 0 }
Easy singletons
object CardFactory {
fun getCard(): Card {
return Card();
}
}
Default arguments
class NutritionFacts(val foodName: String,
val calories: Int,
val protein: Int = 0,
val carbohydrates: Int = 0) {
}
Named arguments
val burger = NutritionFacts("Hamburger", calories = 541,
protein = 14)
val rice = NutritionFacts("Rice", calories = 312,
carbohydrates = 23)
Extension functions
fun Activity.toast(message: CharSequence, duration: Int =
Toast.LENGTH_SHORT) {
Toast.makeText(this, message, duration).show()
}
REPL
➔ Read-eval-print-loop
Other features
➔ Exceptions are all unchecked
➔ Easy to use builder pattern (copy)
➔ Operator overloading (==, +, -, !, etc.)
➔ Better generics syntax (no wildcards)
➔ Automatic delegation pattern syntax
➔ String interpolation (idioms)
➔ KAPT (Kotlin annotation processor)
➔ What about multi-threading, etc? It’s all in Java!
Comparison w/ other emergent (flame war)
➔ Node.js
◆ No support to Java ecosystem
◆ Java is way faster than Node.js
➔ Go
◆ Statically linked (no VM)
◆ No support to Java ecosystem
◆ JVM is faster than Go
What’s the catch?
➔ Data class can’t inherit or be inherited
➔ Classes are final by default (you need to open)
➔ Compilation is incremental only in IDEA and Gradle
➔ Lack some FP functions (can use funKTionale lib)
➔ Null safety checks could be trick in the beginning
➔ Some reserved words conflicts (Mockito*)
Roadmap
➔ async/await/yield
➔ Data class hierarchy support
➔ Type aliases
➔ Bound method references
➔ Take advantage of Java 7/8 bytecode enhancements
➔ Back to work on JavaScript support
DEMO

More Related Content

PDF
A Recovering Java Developer Learns to Go
PDF
Kotlin - Better Java
PDF
JRuby: Pushing the Java Platform Further
PDF
Bringing Concurrency to Ruby - RubyConf India 2014
PPT
GO programming language
PDF
Data Serialization Using Google Protocol Buffers
PDF
QueryPath: It's like PHP jQuery in Drupal!
KEY
QueryPath, Mash-ups, and Web Services
A Recovering Java Developer Learns to Go
Kotlin - Better Java
JRuby: Pushing the Java Platform Further
Bringing Concurrency to Ruby - RubyConf India 2014
GO programming language
Data Serialization Using Google Protocol Buffers
QueryPath: It's like PHP jQuery in Drupal!
QueryPath, Mash-ups, and Web Services

What's hot (19)

ODP
Working with Shared Libraries in Perl
PPTX
Apache Avro in LivePerson [Hebrew]
PDF
Taking Kotlin to production, Seriously
PPTX
Fall in love with Kotlin
PDF
Getting Started with Go
PDF
2017: Kotlin - now more than ever
PDF
Introduction to Google's Go programming language
PPTX
Apache Avro and Messaging at Scale in LivePerson
PPT
Python Introduction
PDF
ApacheCon09: Avro
PDF
Kotlin from-scratch
PDF
HelsinkiJS - Clojurescript for Javascript Developers
PDF
Balisage - EXPath Packaging
PDF
What’s new in Kotlin?
KEY
アジャイルな開発をチームで やってみた(2010年版) - PHP Matsuri編
PPTX
Coding in kotlin
PPTX
Avro - More Than Just a Serialization Framework - CHUG - 20120416
PPTX
Google Protocol Buffers
Working with Shared Libraries in Perl
Apache Avro in LivePerson [Hebrew]
Taking Kotlin to production, Seriously
Fall in love with Kotlin
Getting Started with Go
2017: Kotlin - now more than ever
Introduction to Google's Go programming language
Apache Avro and Messaging at Scale in LivePerson
Python Introduction
ApacheCon09: Avro
Kotlin from-scratch
HelsinkiJS - Clojurescript for Javascript Developers
Balisage - EXPath Packaging
What’s new in Kotlin?
アジャイルな開発をチームで やってみた(2010年版) - PHP Matsuri編
Coding in kotlin
Avro - More Than Just a Serialization Framework - CHUG - 20120416
Google Protocol Buffers
Ad

Viewers also liked (20)

PDF
TDC 2014 - Arquitetura front-end com AngularJS
PDF
NetBeans Day 2015 - Node.js, HTML5, JBoss Forge, and Other Awesome New NetBea...
PDF
TDC 2016 - Rodando JavaScript Server com Wildfly
PPTX
NetBeans Day 2016 - Getting the best of NetBeans IDE
PPTX
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
PDF
O papel e a carreira do arquiteto de software
PDF
TDC 2016 - Simplificando a segurança de sua aplicação com Java EE
PDF
Curso Android Básico
PPTX
React e reactividade Meetup Facebook Developer Circles
PDF
Curso de ReactJS
PDF
JavaOne 2015 - Simplificando a segurança de sua aplicação com Java EE
PPTX
Scala Day by Day
PDF
Знакомьтесь, Kotlin
KEY
Scala
PPTX
Android opetuksessa 11.9.14
PDF
20140531 serebryany lecture01_fantastic_cpp_bugs
PDF
React + Flux (Alt)
PDF
Kotlin Overview
PPTX
Intro to kotlin
PDF
Infinum Android Talks #20 - Benefits of using Kotlin
TDC 2014 - Arquitetura front-end com AngularJS
NetBeans Day 2015 - Node.js, HTML5, JBoss Forge, and Other Awesome New NetBea...
TDC 2016 - Rodando JavaScript Server com Wildfly
NetBeans Day 2016 - Getting the best of NetBeans IDE
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
O papel e a carreira do arquiteto de software
TDC 2016 - Simplificando a segurança de sua aplicação com Java EE
Curso Android Básico
React e reactividade Meetup Facebook Developer Circles
Curso de ReactJS
JavaOne 2015 - Simplificando a segurança de sua aplicação com Java EE
Scala Day by Day
Знакомьтесь, Kotlin
Scala
Android opetuksessa 11.9.14
20140531 serebryany lecture01_fantastic_cpp_bugs
React + Flux (Alt)
Kotlin Overview
Intro to kotlin
Infinum Android Talks #20 - Benefits of using Kotlin
Ad

Similar to JavaOne 2016 - Kotlin: The Language of The Future For JVM? (20)

PDF
Kotlin for Android Development
PDF
Kotlin for Android Developers - 1
PDF
Scala and jvm_languages_praveen_technologist
PDF
A quick and fast intro to Kotlin
PPTX
Dart the Better JavaScript
PDF
Develop realtime web with Scala and Xitrum
PPTX
Scalable and Flexible Machine Learning With Scala @ LinkedIn
PPTX
Golang workshop - Mindbowser
PDF
Android 101 - Kotlin ( Future of Android Development)
PDF
Introducing BoxLang : A new JVM language for productivity and modularity!
PPT
Java Basics
PDF
"Xapi-lang For declarative code generation" By James Nelson
PDF
BCS SPA 2010 - An Introduction to Scala for Java Developers
PDF
An Introduction to Scala for Java Developers
PDF
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
PDF
PySpark with Juypter
PPTX
Go from a PHP Perspective
PDF
Everything-as-code - a polyglot journey.
PDF
Everything-as-code. A polyglot journey.
ODP
Kotlin for Android Development
Kotlin for Android Developers - 1
Scala and jvm_languages_praveen_technologist
A quick and fast intro to Kotlin
Dart the Better JavaScript
Develop realtime web with Scala and Xitrum
Scalable and Flexible Machine Learning With Scala @ LinkedIn
Golang workshop - Mindbowser
Android 101 - Kotlin ( Future of Android Development)
Introducing BoxLang : A new JVM language for productivity and modularity!
Java Basics
"Xapi-lang For declarative code generation" By James Nelson
BCS SPA 2010 - An Introduction to Scala for Java Developers
An Introduction to Scala for Java Developers
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
PySpark with Juypter
Go from a PHP Perspective
Everything-as-code - a polyglot journey.
Everything-as-code. A polyglot journey.

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Approach and Philosophy of On baking technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Big Data Technologies - Introduction.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Encapsulation theory and applications.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
Teaching material agriculture food technology
“AI and Expert System Decision Support & Business Intelligence Systems”
Approach and Philosophy of On baking technology
Review of recent advances in non-invasive hemoglobin estimation
Programs and apps: productivity, graphics, security and other tools
Reach Out and Touch Someone: Haptics and Empathic Computing
Advanced methodologies resolving dimensionality complications for autism neur...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Big Data Technologies - Introduction.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Encapsulation theory and applications.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
MIND Revenue Release Quarter 2 2025 Press Release
Mobile App Security Testing_ A Comprehensive Guide.pdf
Encapsulation_ Review paper, used for researhc scholars
Understanding_Digital_Forensics_Presentation.pptx
sap open course for s4hana steps from ECC to s4
20250228 LYD VKU AI Blended-Learning.pptx
Spectral efficient network and resource selection model in 5G networks

JavaOne 2016 - Kotlin: The Language of The Future For JVM?

  • 1. Kotlin: The Language of The Future For JVM? Leonardo Zanivan @ JavaOne Latin America 2016 [SES12196]
  • 2. Who am I? ➔ Leonardo Zanivan ◆ Software Architect ◆ OSS Contributor ◆ GUJavaSC Member ◆ JCP Member
  • 3. First things first ➔ Why Kotlin? ◆ Concise ◆ Safe ◆ Versatile ◆ Interoperabile ◆ Tooling
  • 4. First things first ➔ History ◆ Conceived in 2010 ◆ Language and compiler are open source (Apache 2) ◆ To be a modern industry standard language ◆ With static typing and a smooth migration path
  • 5. First things first ➔ Why should I care? ◆ Enterprise class support ◆ Production ready ◆ Java #1 language ◆ Productivity
  • 6. First things first ➔ Who is using? ◆ GMC ◆ Expedia ◆ Prezi.com ◆ Telegram ◆ 99 Taxis ◆ JetBrains (IDEA, YouTrack, TeamCity)
  • 7. Easy to learn ➔ Extensive documentation ◆ Online reference http://kotlinlang.org/docs ◆ Online editor & training http://try.kotlinlang.org ◆ Language documentation (PDF with 153 pages) ◆ Books (Kotlin in Action and Kotlin for Android) ◆ GitHub and StackOverflow activity
  • 8. Easy to learn ➔ Fast startup ◆ Intuitive, easy to read & write (opposed to Scala) ◆ No force Functional or OOP styling
  • 9. Easy to learn Online editor & training http://try.kotlinlang.org
  • 10. Easy to use ➔ Tooling support ◆ IDEA Community & Ultimate ◆ Android Studio ◆ Eclipse ◆ Maven / Ant / Gradle ◆ NetBeans plugin (experimental) ◆ Sonar plugin (experimental)
  • 11. Multi target support ➔ Java ➔ Android * ➔ JavaScript (experimental)
  • 12. Easy to migrate ➔ Mix Java and Kotlin source files in the same project ➔ Java to Kotlin source conversion tool ➔ Compatible with Java 6 bytecode (100% compatible) ➔ Integrate with existing Java frameworks ➔ No runtime overhead ➔ No cost to adopt
  • 13. KDoc ➔ Dokka is the documentation engine for Kotlin.
  • 14. Feature: Null safety out-of-the-box val givenName: String? = null val len = givenName?.length //assign null val len = givenName!!.length //assert null
  • 15. Feature: Lean syntax (no get/set) data class Book(var title: String, var author: Author) val book = Book(“Kotlin at JavaOne”,”Leonardo”) println(book.title)
  • 16. Feature: Smart casts and type inference if (node is Leaf) { return node.symbol; } val myString = "Some text"
  • 17. Functional programming val numbers = arrayListOf(-42, 17, 13, -9, 12) val nonNegative = numbers.filter { it >= 0 }
  • 18. Easy singletons object CardFactory { fun getCard(): Card { return Card(); } }
  • 19. Default arguments class NutritionFacts(val foodName: String, val calories: Int, val protein: Int = 0, val carbohydrates: Int = 0) { }
  • 20. Named arguments val burger = NutritionFacts("Hamburger", calories = 541, protein = 14) val rice = NutritionFacts("Rice", calories = 312, carbohydrates = 23)
  • 21. Extension functions fun Activity.toast(message: CharSequence, duration: Int = Toast.LENGTH_SHORT) { Toast.makeText(this, message, duration).show() }
  • 23. Other features ➔ Exceptions are all unchecked ➔ Easy to use builder pattern (copy) ➔ Operator overloading (==, +, -, !, etc.) ➔ Better generics syntax (no wildcards) ➔ Automatic delegation pattern syntax ➔ String interpolation (idioms) ➔ KAPT (Kotlin annotation processor) ➔ What about multi-threading, etc? It’s all in Java!
  • 24. Comparison w/ other emergent (flame war) ➔ Node.js ◆ No support to Java ecosystem ◆ Java is way faster than Node.js ➔ Go ◆ Statically linked (no VM) ◆ No support to Java ecosystem ◆ JVM is faster than Go
  • 25. What’s the catch? ➔ Data class can’t inherit or be inherited ➔ Classes are final by default (you need to open) ➔ Compilation is incremental only in IDEA and Gradle ➔ Lack some FP functions (can use funKTionale lib) ➔ Null safety checks could be trick in the beginning ➔ Some reserved words conflicts (Mockito*)
  • 26. Roadmap ➔ async/await/yield ➔ Data class hierarchy support ➔ Type aliases ➔ Bound method references ➔ Take advantage of Java 7/8 bytecode enhancements ➔ Back to work on JavaScript support
  • 27. DEMO