SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Working with Shared Libraries in Perl
Working with Shared Libraries in PerlWorking with Shared Libraries in Perl
Working with Shared Libraries in Perl
Ido Kanner
 
アジャイルな開発をチームで やってみた(2010年版) - PHP Matsuri編
アジャイルな開発をチームで やってみた(2010年版) - PHP Matsuri編アジャイルな開発をチームで やってみた(2010年版) - PHP Matsuri編
アジャイルな開発をチームで やってみた(2010年版) - PHP Matsuri編
Hiroki Ohtsuka
 

Mais procurados (19)

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

Destaque

NetBeans Day 2015 - Node.js, HTML5, JBoss Forge, and Other Awesome New NetBea...
NetBeans Day 2015 - Node.js, HTML5, JBoss Forge, and Other Awesome New NetBea...NetBeans Day 2015 - Node.js, HTML5, JBoss Forge, and Other Awesome New NetBea...
NetBeans Day 2015 - Node.js, HTML5, JBoss Forge, and Other Awesome New NetBea...
Leonardo Zanivan
 
Android opetuksessa 11.9.14
Android opetuksessa 11.9.14Android opetuksessa 11.9.14
Android opetuksessa 11.9.14
Matleena Laakso
 
20140531 serebryany lecture01_fantastic_cpp_bugs
20140531 serebryany lecture01_fantastic_cpp_bugs20140531 serebryany lecture01_fantastic_cpp_bugs
20140531 serebryany lecture01_fantastic_cpp_bugs
Computer Science Club
 

Destaque (20)

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

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

BCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersBCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java Developers
Miles Sabin
 

Semelhante a JavaOne 2016 - Kotlin: The Language of The Future For JVM? (20)

Kotlin for Android Development
Kotlin for Android DevelopmentKotlin for Android Development
Kotlin for Android Development
 
Kotlin for Android Developers - 1
Kotlin for Android Developers - 1Kotlin for Android Developers - 1
Kotlin for Android Developers - 1
 
Scala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistScala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologist
 
A quick and fast intro to Kotlin
A quick and fast intro to Kotlin A quick and fast intro to Kotlin
A quick and fast intro to Kotlin
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
 
Scalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedInScalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedIn
 
Golang workshop - Mindbowser
Golang workshop - MindbowserGolang workshop - Mindbowser
Golang workshop - Mindbowser
 
Android 101 - Kotlin ( Future of Android Development)
Android 101 - Kotlin ( Future of Android Development)Android 101 - Kotlin ( Future of Android Development)
Android 101 - Kotlin ( Future of Android Development)
 
Java Basics
Java BasicsJava Basics
Java Basics
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson
 
BCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java DevelopersBCS SPA 2010 - An Introduction to Scala for Java Developers
BCS SPA 2010 - An Introduction to Scala for Java Developers
 
An Introduction to Scala for Java Developers
An Introduction to Scala for Java DevelopersAn 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)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
 
PySpark with Juypter
PySpark with JuypterPySpark with Juypter
PySpark with Juypter
 
Go from a PHP Perspective
Go from a PHP PerspectiveGo from a PHP Perspective
Go from a PHP Perspective
 
Everything-as-code. A polyglot journey.
Everything-as-code. A polyglot journey.Everything-as-code. A polyglot journey.
Everything-as-code. A polyglot journey.
 
Everything-as-code - a polyglot journey.
Everything-as-code - a polyglot journey.Everything-as-code - a polyglot journey.
Everything-as-code - a polyglot journey.
 
Scala ntnu
Scala ntnuScala ntnu
Scala ntnu
 
Exploring Kotlin
Exploring KotlinExploring Kotlin
Exploring Kotlin
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

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