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
81
Kotlin: An interoperability story
Yan
November 20, 2018
Tweet
Share
More Decks by Yan
See All by Yan
K2のKotlin IDEプラグインの中を覗いてみよう♪
yanex
1
4.2k
K2への道。コンパイラを作り直すってどういうこと?
yanex
2
1k
Other Decks in Programming
See All in Programming
時計仕掛けのCompose
mkeeda
1
300
DROBEの生成AI活用事例 with AWS
ippey
0
130
もう僕は OpenAPI を書きたくない
sgash708
5
1.8k
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
530
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
170
Formの複雑さに立ち向かう
bmthd
1
860
Rails アプリ地図考 Flush Cut
makicamel
1
120
AWS Organizations で実現する、 マルチ AWS アカウントのルートユーザー管理からの脱却
atpons
0
150
Conform を推す - Advocating for Conform
mizoguchicoji
3
690
sappoRo.R #12 初心者セッション
kosugitti
0
260
PHPカンファレンス名古屋2025 タスク分解の試行錯誤〜レビュー負荷を下げるために〜
soichi
1
210
技術を根付かせる / How to make technology take root
kubode
1
250
Featured
See All Featured
Navigating Team Friction
lara
183
15k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Raft: Consensus for Rubyists
vanstee
137
6.8k
Designing for Performance
lara
604
68k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
KATA
mclloyd
29
14k
The Language of Interfaces
destraynor
156
24k
GraphQLとの向き合い方2022年版
quramy
44
13k
Why Our Code Smells
bkeepers
PRO
336
57k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Embracing the Ebb and Flow
colly
84
4.6k
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! ❤