Applications are often created for three platforms (Web, iOS, Android).
Currently the tech stack we are using are AngularJS (web) and Ionic/Cordova (iOS and Android). Since they are JavaScript based, we are able to write the core business logics (e.g. login) once and then share it across three (I know, it's two) platforms, leaving the UI implementations to the individual platforms. This method is awesome which helps us save so much time and human resources - core business logics are written and tested once and deployed everywhere. Google used similar method to develop Inbox, which allows them to share 70% of the code using J2Objc.
We want to apply the same awesomeness to the new era - Swift, Kotlin and a JavaScript based web framework (e.g. React/VueJs). We are open to using any one of these three languages to write the shared code. I am new to Swift and Kotlin but here are my best research results so far:
- SwiftKotlin Converts Swift to Kotlin
- KotlinJS Converts Kotlin to Js
So the development process would be Swift -> Kotlin -> JavaScript. However, the converted code are not production ready and requires manually editing. Also, the code written has to be language/platform library independent. For example, to write a JSON parser, we use Codable protocol in Swift 4, Moshi (external lib) in Kotlin and JavaScript can natively manipulate JSON.
I'd like to see if anyone has some nice solution to this question. Or maybe the question is to figure out what can be shared and what has to be done three times. Or this process is taking more time or error-prone and we should write the same logic three different times.
Thanks!