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
61
Kotlin Everywhere
Roberto Orgiu
July 20, 2018
Tweet
Share
More Decks by Roberto Orgiu
See All by Roberto Orgiu
Wellness & Droid
tiwiz
0
84
Behind the curtains
tiwiz
0
28
The Importance of Being Tested
tiwiz
0
350
An Android Dev start to Kotlin MPP
tiwiz
0
120
Fantastic API and where to find them
tiwiz
0
42
Flipping the Koin @ GDG Dev Party
tiwiz
1
36
Flipping the Koin
tiwiz
2
130
Trip into the async world @ NYC Kotlin Meetup
tiwiz
0
70
Trip into the async world
tiwiz
1
92
Other Decks in Technology
See All in Technology
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
180
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
フロントエンド設計にモブ設計を導入してみた / 20241212_cloudsign_TechFrontMeetup
bengo4com
0
1.9k
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
100
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
530
開発生産性向上! 育成を「改善」と捉えるエンジニア育成戦略
shoota
2
340
生成AIのガバナンスの全体像と現実解
fnifni
1
190
2024年にチャレンジしたことを振り返るぞ
mitchan
0
140
複雑性の高いオブジェクト編集に向き合う: プラガブルなReactフォーム設計
righttouch
PRO
0
110
20241220_S3 tablesの使い方を検証してみた
handy
4
390
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
5
38k
社外コミュニティで学び社内に活かす共に学ぶプロジェクトの実践/backlogworld2024
nishiuma
0
260
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
GitHub's CSS Performance
jonrohan
1030
460k
Why Our Code Smells
bkeepers
PRO
335
57k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Scaling GitHub
holman
458
140k
Making Projects Easy
brettharned
116
5.9k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
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