Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
4k
K2への道。コンパイラを作り直すってどういうこと?
yanex
2
990
Other Decks in Programming
See All in Programming
カンファレンスの「アレ」Webでなんとかしませんか? / Conference “thing” Why don't you do something about it on the Web?
dero1to
2
160
Criando Commits Incríveis no Git
marcelgsantos
1
130
競技プログラミングで 基礎体力を身につけよう / You can get basic skills through competitive programming
mdstoy
0
150
CSC305 Lecture 25
javiergs
PRO
0
110
イマのCSSでできる インタラクション最前線 + CSS最新情報
clockmaker
5
3.8k
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
6
3.1k
似たもの同士のPerlとPHP
uzulla
1
110
Missing parts when designing and implementing Android UI
ericksli
0
390
Develop iOS apps with Neovim / vimconf_2024
uhooi
1
310
Full stack testing :: basic to basic
up1
1
870
flutterkaigi_2024.pdf
kyoheig3
0
460
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
2
280
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Designing for Performance
lara
604
68k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Music & Morning Musume
bryan
46
6.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
1
89
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.3k
Fireside Chat
paigeccino
34
3.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
A Modern Web Designer's Workflow
chriscoyier
693
190k
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! ❤