Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Kotlin: An interoperability story
Search
Yan
November 20, 2018
Programming
0
76
Kotlin: An interoperability story
Yan
November 20, 2018
Tweet
Share
More Decks by Yan
See All by Yan
K2のKotlin IDEプラグインの中を覗いてみよう♪
yanex
0
1.9k
K2への道。コンパイラを作り直すってどういうこと?
yanex
2
920
Other Decks in Programming
See All in Programming
GoogleI/O2024 LT報告会資料
shinsukefujita1126
0
200
スタートアップ企業が実践する「身の丈スクラム」の現在地 / Current State of 'Right-Sized Scrum' Practices in Startups
ar_tama
12
3.7k
高品質と高スピードを両立させるテストアプローチ/Test Approach that Improves Quality and Agility Together
goyoki
12
3.9k
プラットフォームエンジニアリングを 普及と実践し続けて見えてきた利点とリスク
zawa_zawa0210
2
940
奥が深いメールのシステム / The depth of Email system
linyows
3
200
Kotlin Collection関数をマスター
masayukisuda
0
2.8k
設計の考え方 - インターフェースと腐敗防止層編 #phpconfuk / Interface and Anti Corruption Layer
okashoi
7
1.5k
インプロセスQAとテスト自動化の両輪で進める食べログの開発生産性と品質改善の3年間
hagevvashi
2
930
Adding Tests to Untestable Legacy Code
afilina
PRO
0
190
♾️ マルチプロダクトの組織でマイクロサービスアーキテクチャを支えるCICDプラットフォーム設計
hiroki_hasegawa
3
290
関数型プログラミングへの第一歩: 純粋関数を知る
74k3z4k1
0
120
Gradle Version Catalog with KTS [KotlinConf'24 Global]
junjaboy
0
110
Featured
See All Featured
Statistics for Hackers
jakevdp
791
220k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
22
1.8k
4 Signs Your Business is Dying
shpigford
177
21k
Why Our Code Smells
bkeepers
PRO
331
56k
What the flash - Photography Introduction
edds
64
11k
Design by the Numbers
sachag
276
18k
GraphQLの誤解/rethinking-graphql
sonatard
58
9.5k
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.8k
The Mythical Team-Month
searls
217
42k
A better future with KSS
kneath
231
17k
The MySQL Ecosystem @ GitHub 2015
samlambert
246
12k
Building Effective Engineering Teams - LeadDev
addyosmani
41
2.1k
Transcript
Kotlin: An interoperability story Yan Zhulanow, JetBrains Nov 2018
Good Java interoperability from the very beginning
Good Java interoperability from the very beginning Because we needed
it for our projects
Compiles to JVM bytecode equals? Good Java interoperability
Compiles to JVM bytecode equals? Good Java interoperability NO.
String? Nullable types
val name: String = null
val name: String = null Null can not be a
value of a non-null type String
val name: String? = null name.length
val name: String? = null name.length Only safe (?.) or
non-null asserted (!!.) calls are allowed
System.getProperty("my.property") String String? What about Java?
System.getProperty("my.property") String? What about Java?
class DetailsActivity : FragmentActivity() { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) setOrientation( getResources()!! .getConfiguration()!! .getOrientation()!!) getSupportFragmentManager()!! .beginTransaction()!! .add(android.R.id.content, DetailsFragment())!! .commit() } }
String! Platform types
Interoperable with Java
Interoperable with Java Ecosystem
Interoperable with Java Ecosystem Build tools Post-processors Analyzers Frameworks IDE
class Worker { @field:Inject var log: Logger? = null fun
process(task: Task) { log?.debug("$task started") task.run() log?.debug("$task ended") } }
class Worker { @field:Inject var log: Logger? = null fun
process(task: Task) { log?.debug("$task started") task.run() log?.debug("$task ended") } }
class Worker { @field:Inject lateinit var log: Logger fun process(task:
Task) { log.debug("$task started") task.run() log.debug("$task ended") } }
@field:Inject Annotations with use-site targets
allopen noarg sam-with-receiver Compiler plugins
Inspections Java AST
UAST (universal AST) Java AST Kotlin AST Inspections
Interoperable with Java
Interoperable with Java Android
Tiny runtime around 1 MB
Dalvik/ART support
Tooling support Build tools, Lint, Android Extensions
Annotation processor support Dagger, ButterKnife, the rest 9000 of them
Kotlin 1.3 Multi-platform projects!
Java Android Interoperable with
Java Android JavaScript Interoperable with
Java Android JavaScript C Interoperable with
Java Android JavaScript C Objective-C Interoperable with
Java Android JavaScript C Objective-C Swift Interoperable with
Java Android JavaScript C Objective-C Swift ??? Interoperable with
Java Android JavaScript C Objective-C Swift ??? Interoperable with ecosystem
We ❤ Kotlin. And we want to use it everywhere.
because
We ❤ Kotlin. And we want to use it everywhere.
because Back-end Front-end Android iOS Embedded Games Scripting ICPC Desktop Science
https://kotlinlang.org/
https://play.kotlinlang.org/
None
Thanks! ❤