Vienna Kotlin Meetup, 13. 9. 2017
Javascript is nice
But Kotlin is nicer
Javascript community:
Use the same language in the frontend and the backend (with node.js).
(Future) Kotlin community:
Let's do the same!
And also add native support!
Core: Transpiler & Tooling
Kotlin:
fun main(args: Array<String>) = println("Hi Kotlin Vienna!")
Javascript:
function main(args) {
console.log('Hi Kotlin Vienna!')
}
Calling Javascript functions from Kotlin
js("console.log(3+4)")
external class Window {
fun alert(message: String): Unit
}
external val window: Window
external class Window {
fun alert(message: String): Unit
}
external val window: Window
external fun unknownReturnType(): dynamic
val dyn: dynamic = unknownReturnType()
dyn.whatever(123)
dyn.foo.bar[4].whatever(123)
fun foo(person: String) = "Hi $person"
console.log(MyModule.foo('Martin'));
console.log(require('myModule').foo('Martin'));
@JSName for explicit naming
Very limited
Just "simpleName" and "isInstance"
No annotation support!
Architecture is right but not implemented (yet).
Documentation for language support is good.
Documentation for tooling isn't.
Don't migrate (yet)!
Don't use in production!
But try it in your next pet project!
Slack channels: #javascript & #multiplattform