Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Kotlin Everywhere
Roberto Orgiu
July 20, 2018
Technology
0
32
Kotlin Everywhere
Roberto Orgiu
July 20, 2018
Tweet
Share
More Decks by Roberto Orgiu
See All by Roberto Orgiu
Wellness & Droid
tiwiz
0
10
Behind the curtains
tiwiz
0
11
The Importance of Being Tested
tiwiz
0
130
An Android Dev start to Kotlin MPP
tiwiz
0
53
Fantastic API and where to find them
tiwiz
0
26
Flipping the Koin @ GDG Dev Party
tiwiz
1
27
Flipping the Koin
tiwiz
2
88
Trip into the async world @ NYC Kotlin Meetup
tiwiz
0
49
Trip into the async world
tiwiz
1
62
Other Decks in Technology
See All in Technology
ニフティでSRE推進活動を始めて取り組んできたこと
niftycorp
2
300
暗号資産ウォレット入門(MetaMaskの入門~NFTの購入~詐欺の注意事項など)
kayato
2
190
HTTP Session Architecture Pattern
chiroito
1
400
スタートアップ入社4日目までに考えたAWSのセキュリティ向上/ Startup AWS Security
shonansurvivors
3
2.9k
AWS Control TowerとAWS Organizationsを活用した組織におけるセキュリティ設定
fu3ak1
2
630
Puny to Powerful PostgreSQL Rails Apps
andyatkinson
PRO
0
270
Research Paper Introduction #98 "NSDI 2022 recap"
cafenero_777
0
200
JAWS-UG 朝会 #33 登壇資料
takakuni
0
380
完全に理解した incremetal 〜そして、何もわからないへ〜
mashiike
0
210
Graph API について
miyakemito
0
230
キャッチアップ Android 13 / Catch up Android 13
yanzm
2
1.1k
LINEスタンプの実例紹介 小さく始める障害検知・対応・振り返りの 改善プラクティス
line_developers
PRO
3
1.4k
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
19
2.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
350
21k
Build The Right Thing And Hit Your Dates
maggiecrowley
19
1.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
396
62k
Why Our Code Smells
bkeepers
PRO
324
54k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
498
130k
Designing the Hi-DPI Web
ddemaree
272
32k
Reflections from 52 weeks, 52 projects
jeffersonlam
337
17k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
119
28k
Designing on Purpose - Digital PM Summit 2013
jponch
106
5.6k
A designer walks into a library…
pauljervisheath
196
16k
jQuery: Nuts, Bolts and Bling
dougneiner
56
6.4k
Transcript
Kotlin everywhere
Who’s speaking Rob @ NYT Boris @ ClearScore 2
#CPIT2 sli.do Join the discussion
Where https://pusher.com/state-of-kotlin
Desktop apps with a little bit of Tornado™
• JavaFX • Beautiful DSL • UI + Background thread
• Injection • REST • Field validation • Can work™ with JS TornadoFX 6
tornadofx.io goo.gl/qSjBPG goo.gl/gcrZss
iOS apps and Android (but we wanted the WOW moment)
Kotlin Native COMMON no platform specific dependencies class/function declaration 9
PLATFORM implementations of platform-dependent declarations in the common module always an implementation of a single common module REGULAR targets specific platform can be dependency of platform modules can depend on platform modules
10
◇ common module defines expected declarations ◇ expected declarations never
contain any implementation code 11 expected
12 actual ◇ platform module provides actual declarations ◇ actual
declarations must match expected declarations
13 package org.jetbrains.foo expect class Foo(bar: String) { fun frob()
} fun main(args: Array<String>) { Foo("Hello").frob() }
14 package org.jetbrains.foo actual class Foo actual constructor(val bar: String)
{ actual fun frob() { println("Frobbing the $bar") } }
JVM Backend
16
Javascript Both Frontend and Backend!
18
19
◇ You can set and call everything you want on
properties of this type ◇ Disables compiler checks (beware of runtime errors) 20 dynamic
◇ Kotlin assumes the implementation is provided by the developer
(in JS) ◇ The compiler will not generate JS code for this function ◇ No auto completion 21 external
22 external fun require(module: String): dynamic fun main(args: Array<String>) {
val app = require(“express”) app.get(“/hello”, {req, res -> res.send(“Hello world!”) }) }
} 23 { Kotlin wrappers
24 @JsModule(“express”) external class Express { fun get( route: String,
callback: (req: Request, res: Response) -> Unit ) external class Request external class Response { fun send(data: String) } }
} 25 { Kotlin wrappers https://github.com/JetBrains/kotlin-wrappers
Thanks! Any questions? You can find us at: ◇ @_tiwiz
◇ @borisdamato 26