9. 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
20. ◇ You can set and call
everything you want on
properties of this type
◇ Disables compiler checks
(beware of runtime errors)
20
dynamic
21. ◇ 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. 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!”)
})
}