3 ms·
I have a bit trouble understanding what this is. Does it mean that I have to write my whole webapp or mobile-app in a Kotlin framework for it to give value? Or
by matsemann 3y ago
I have a bit trouble understanding what this is. Does it mean that I have to write my whole webapp or mobile-app in a Kotlin framework for it to give value? Or can I take some of my Kotlin libraries and convert so they're callable from js so I don't have to duplicate certain logic?
- sdflhasjd 3y agoThe latter. You write your shared libraries in Kotlin, compile it for multiple runtime targets, then call your Kotlin code from whatever runtime you're using.
- tarkin2 3y agoWrite your business logic in Kotlin with Kotlin libraries. Write your UI in Js/Android/iOS.
- jurmous 3y agoIt is also possible to write the UI in Kotlin cross platform with Compose Multiplatform.
- jurmous 3y agoYou can work in whatever way makes sense for you to share code. Kotlin allows you to call native code (JS/C/ObjC/Java/WASM) from Kotlin, or you can call Kotlin functions from native code (JS/C/ObjC/Java/WASM). So you choose on what level you want to create shared code. So it is quite flexible so it is up to you on what level you want to share code. It can either be a low level library, a middle level library. And with maturing Jetpack Compose it is possible to build the whole app including UI multiplatform without leaving Kotlin.