Kotlin could however be awesome for cross-platform mobile dev, targeting both iOS and Android with a lot of shared code and truly native apps on both.
I wouldn't use kotlin for cross-platform mobile dev. There are few things Android and iOS share, you end up having to codebases in the same language (which it is good in its way). If you want to do truly native apps, just avoid sharing code because you will use different patterns and different libraries and apis. You could share the business logic but that is something I think should be on the server not in the app. The app is only the frontend.
- data structures for your domain objects
- network code (just plug in an appropriate platform-specific driver)
- like you said, business logic - especially if the app has to work offline
- if you're using something like https://realm.io/, you could avoid a lot of duplication
Anything to do with the UI then has to be platform-specific of course.
not sure there are a problem since you have data classes in kotlin. I bet swift provides something similar.
> - network code
In Android you must use okhttp, and I guess there are similar powerful libraries in swift for this.
> - if you're using something like https://realm.io/
Last time I checked it I decided to keep using SQLite as it allows me to do everything I want. Realm doesn't support "complex" SQL queries.
Again, just business logic. But there is no too much apart from field validation or simplex operations to show the data (or it should be much more). Complex things must be in the server, that is the best way to share business logic among all your apps in all the platforms.
isn't this what people are doing with JavaScript?
Kotlin could offer better performance and certainly offers strong type safety throughout the stack, which I at least certainly believe gives a better programming experience.
For example this compiles without warnings:
const foo: Promise<string|null> = Promise.resolve(null);
const bar: Promise<string> = foo;
bar.then((value) => value.toString()); // runtime null errorWhich is the same thing as in Java and plenty of other languages.
Although using the same language in different environments obviously feels a bit different.
Kotlin could run on all supported platforms and reuse Java libraries.
Which is even awesome for Microsoft to adopt LLVM.