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
90
Kotlin: An interoperability story
Yan
November 20, 2018
Tweet
Share
More Decks by Yan
See All by Yan
K2のKotlin IDEプラグインの中を覗いてみよう♪
yanex
1
4.6k
K2への道。コンパイラを作り直すってどういうこと?
yanex
2
1.1k
Other Decks in Programming
See All in Programming
ソフトウェアテスト徹底指南書の紹介
goyoki
1
150
Deep Dive into Kotlin Flow
jmatsu
1
330
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
6
2.4k
Kiroで始めるAI-DLC
kaonash
2
580
Oracle Database Technology Night 92 Database Connection control FAN-AC
oracle4engineer
PRO
1
440
MCPで実現するAIエージェント駆動のNext.jsアプリデバッグ手法
nyatinte
7
1.1k
速いWebフレームワークを作る
yusukebe
5
1.7k
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
アセットのコンパイルについて
ojun9
0
120
今だからこそ入門する Server-Sent Events (SSE)
nearme_tech
PRO
3
170
Android端末で実現するオンデバイスLLM 2025
masayukisuda
1
150
複雑なドメインに挑む.pdf
yukisakai1225
5
1.1k
Featured
See All Featured
Music & Morning Musume
bryan
46
6.8k
A better future with KSS
kneath
239
17k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
A Modern Web Designer's Workflow
chriscoyier
696
190k
GraphQLとの向き合い方2022年版
quramy
49
14k
It's Worth the Effort
3n
187
28k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Six Lessons from altMBA
skipperchong
28
4k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
What's in a price? How to price your products and services
michaelherold
246
12k
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! ❤