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 Everywhere
Search
Roberto Orgiu
July 20, 2018
Technology
0
46
Kotlin Everywhere
Roberto Orgiu
July 20, 2018
Tweet
Share
More Decks by Roberto Orgiu
See All by Roberto Orgiu
Wellness & Droid
tiwiz
0
75
Behind the curtains
tiwiz
0
24
The Importance of Being Tested
tiwiz
0
280
An Android Dev start to Kotlin MPP
tiwiz
0
100
Fantastic API and where to find them
tiwiz
0
34
Flipping the Koin @ GDG Dev Party
tiwiz
1
33
Flipping the Koin
tiwiz
2
120
Trip into the async world @ NYC Kotlin Meetup
tiwiz
0
61
Trip into the async world
tiwiz
1
84
Other Decks in Technology
See All in Technology
Delivering Millions of Messages within seconds @ Duolingo
pelelgrino
0
350
Azure犬駆動開発の記録/GlobalAzureFukuoka2024_20240420
nina01
1
220
Python と Snowflake はズッ友だょ!~ Snowflake の Python 関連機能をふりかえる ~
__allllllllez__
1
120
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
1
250
アクセシビリティを考慮したUI/CSSフレームワーク・ライブラリ選定
yajihum
2
1k
Compose Compiler Metricsを使った実践的なコードレビュー
tomorrowkey
1
220
AOAI をきっかけに 社内の Azure 管理を見直した話
recruitengineers
PRO
1
300
Cloud Native Java with Spring Boot (CNCF Aarhus, April 2024)
thomasvitale
1
170
データベース02: データベースの概念
trycycle
0
160
Google Cloud Next '24 Recap(Cloud Run/k8s)
mokocm
0
240
Azure Container Apps + Bicep 〜 こんな感じで運用しています
kaz29
2
480
いつか使うかも貯金してたらめちゃめちゃ機能が増えてた話
riyaamemiya
0
300
Featured
See All Featured
A Tale of Four Properties
chriscoyier
151
22k
How STYLIGHT went responsive
nonsquared
92
4.8k
Git: the NoSQL Database
bkeepers
PRO
422
63k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
21
1.6k
Building Better People: How to give real-time feedback that sticks.
wjessup
355
18k
Become a Pro
speakerdeck
PRO
11
4.5k
We Have a Design System, Now What?
morganepeng
43
6.8k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.9k
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
357
22k
The Brand Is Dead. Long Live the Brand.
mthomps
49
29k
Rails Girls Zürich Keynote
gr2m
91
13k
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