● JavaFX
● Beautiful DSL
● UI + Background thread
● Injection
● REST
● Field validation
● Can work™ with JS
TornadoFX
6
Slide 7
Slide 7 text
tornadofx.io
goo.gl/qSjBPG
goo.gl/gcrZss
Slide 8
Slide 8 text
iOS apps
and Android (but we wanted the WOW moment)
Slide 9
Slide 9 text
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
Slide 10
Slide 10 text
10
Slide 11
Slide 11 text
◇ common module defines
expected declarations
◇ expected declarations never
contain any implementation
code
11
expected
Slide 12
Slide 12 text
12
actual
◇ platform module provides
actual declarations
◇ actual declarations must
match expected
declarations
Slide 13
Slide 13 text
13
package org.jetbrains.foo
expect class Foo(bar: String) {
fun frob()
}
fun main(args: Array) {
Foo("Hello").frob()
}
Slide 14
Slide 14 text
14
package org.jetbrains.foo
actual class Foo actual constructor(val bar:
String) {
actual fun frob() {
println("Frobbing the $bar")
}
}
Slide 15
Slide 15 text
JVM Backend
Slide 16
Slide 16 text
16
Slide 17
Slide 17 text
Javascript
Both Frontend and Backend!
Slide 18
Slide 18 text
18
Slide 19
Slide 19 text
19
Slide 20
Slide 20 text
◇ You can set and call
everything you want on
properties of this type
◇ Disables compiler checks
(beware of runtime errors)
20
dynamic
Slide 21
Slide 21 text
◇ 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
Slide 22
Slide 22 text
22
external fun require(module: String): dynamic
fun main(args: Array) {
val app = require(“express”)
app.get(“/hello”, {req, res ->
res.send(“Hello world!”)
})
}
Slide 23
Slide 23 text
}
23
{
Kotlin wrappers
Slide 24
Slide 24 text
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)
}
}