Live data from Hacker News

Kotlin Multiplatform for Android and iOS Apps

rockandnull.com

51–60 of 82 posts

Re: Kotlin Multiplatform for Android and iOS Apps

#51
post #42

I'm puzzled why Kotlin isn't getting enough attention on HN, at least as much as Rust or Zig. Kotlin is indeed popular in it's specific domain (Android & Java). But the company is keen to position it as "write once run anywhere" space with a strong focus on multiplatform development. 1. The build system provides platform specific bindings for free (huge plus compared to the hassle of writing the core in C/C++ and the…

I use Kotlin daily at my job (I have to) and I'm not impressed. It is a new language that ignores most of the innovations in Programming Language Theory from the last 20 years. It only improves on Java by making the syntax less verbose and adding coroutines but almost doesn't add any benefits in terms of semantics.

Hi, I’m curious, can you elaborate on the language features that you think Kotlin ignores?

Re: Kotlin Multiplatform for Android and iOS Apps

#52

Earlier quoted context omitted.

- Flutter is reliable and simple to build with - React Native is easy to find workers for but slow - Kotlin is somewhat in the middle of both but has better performance - Tauri is coming out of left field with webview2 apps but it's very early days for their mobile plans and completely unproven Kotlin does a good job with all the compromises you have to make with cross platform but it's quite application dependent?

I started building a Flutter app recently and so far I’ve been quite impressed. The ecosystem is surprisingly mature and dev velocity has been good even though I’m learning a new language and framework at the same time. On a purely technological level I’d take this over React Native any day and I have a lot of React experience. I think Google has a winner on their hands here if they don’t give up on it.

Dart is honestly so easy to pick up, seen it cop some flack on here but its simplicity is a virtue, have onboarded people with zero experience and they are perfectly productive within a week. There's not many languages like that.

Re: Kotlin Multiplatform for Android and iOS Apps

#53
post #42

I'm puzzled why Kotlin isn't getting enough attention on HN, at least as much as Rust or Zig. Kotlin is indeed popular in it's specific domain (Android & Java). But the company is keen to position it as "write once run anywhere" space with a strong focus on multiplatform development. 1. The build system provides platform specific bindings for free (huge plus compared to the hassle of writing the core in C/C++ and the…

I use Kotlin daily at my job (I have to) and I'm not impressed. It is a new language that ignores most of the innovations in Programming Language Theory from the last 20 years. It only improves on Java by making the syntax less verbose and adding coroutines but almost doesn't add any benefits in terms of semantics.

> It is a new language that ignores most of the innovations in Programming Language Theory from the last 20 years.

Such as?

Re: Kotlin Multiplatform for Android and iOS Apps

#54

Earlier quoted context omitted.

iOS dev here. What you're missing is that a ton of native-code developers (me included) aren't interested in adopting an abstraction layer that has to be tweaked to approximate the look and feel of the native OS UI layer when we could just built it natively to begin with and save all that effort. We've seen PhoneGap/Cordova, we've seen React Native and we'll keep seeing money thrown away on pretending that there aren…

The idea is you can write SwiftUI on iOS, whilst connecting to business logic written in Kotlin.

im not a phone app dev, but im curious, cant you already write backend code in another language and the ui in swift

Re: Kotlin Multiplatform for Android and iOS Apps

#56
post #9

I've mostly stayed away from mobile development because Android projects look too complicated to get started on even NDK projects. The value of learning those APIs to me isn't even close to what you get by learning Web APIs. So if I invested my time to learning it I don't feel Is get as much out of it. Maybe something like Kotlin/Compose Multiplatform can help. But, really if they made Android APIs (or React-native/F…

I used to favor the web for the same reasons but the churn in web technology is at least as bad in mobile. The knowledge I had three years ago is almost useless now. And on top of that you have to deal with a platform that is really a big pile of quick hacks that was never intended for building complex and performant applications.

I don't use frameworks or compile to js languages. I've only learned the plain html, css, js and DOM APIs. I have the same reservations about React and Typescript as I do these mobile APIs.

Then again my use of these things is that of a hobbyist so I have a choice in these things.

Re: Kotlin Multiplatform for Android and iOS Apps

#57
post #36
post #9

I've mostly stayed away from mobile development because Android projects look too complicated to get started on even NDK projects. The value of learning those APIs to me isn't even close to what you get by learning Web APIs. So if I invested my time to learning it I don't feel Is get as much out of it. Maybe something like Kotlin/Compose Multiplatform can help. But, really if they made Android APIs (or React-native/F…

Try Flutter. It's amazing how easy it is to get started with a desktop app in any OS, and then just run it on mobile (or emulators which are easy to install via Android Studio or VS Code) when you want to without having to deal with almost any of the crap iOS and Android developers need to... Flutter generates all manifests and what not, and the docs show exactly what to do to sign artifacts and stuff that requires y…

I did some time ago. Back then it seemed like Flutter was like a parallel world where a different set of languages and APIs existed instead of the Web APIs. Which I thought was interesting. However unlike Web APIs Flutter didn't have the girth of resources tutorials and documentation available.

I don't know exactly if that's what stopped me or maybe I'm just just not meant for learning UI libraries of any sort as even something like Dear Imgui has been unattractive to me.

Re: Kotlin Multiplatform for Android and iOS Apps

#58
post #3

From my admittedly limited experience KMM is a complete mess. There doesn't seem to be a reasonable feature set across platforms. Even the standard library has massive holes, forcing you to littler your code with expect/actuals everywhere. This might be manageable for my own code, but completely destroys the ecosystem. A very large number of important libraries only works the JVM. Jetpack Compose and Compose Multipla…

I would argue that the shared feature set is quite reasonable. You get coroutines, you get Ktor, date/time libraries, kotlinx.serialization. You even get metaprogramming via KSP. I basically only write expect/actual implementations to talk to platform APIs, but even those, when abstracted correctly behave just like a normal API to users. You still write the UI layer natively. IMO this is a positive not a negative unl…

The JVM’s biggest feature is all the millions of great quality packages it has.

Re: Kotlin Multiplatform for Android and iOS Apps

#59

Earlier quoted context omitted.

The idea is you can write SwiftUI on iOS, whilst connecting to business logic written in Kotlin.

im not a phone app dev, but im curious, cant you already write backend code in another language and the ui in swift

Business logic is not only about backend. Apps usually have a lot of client-side logic that can be written once in KMM and used on both platforms. See [1] for a high level architecture diagram.

I'm an iOS dev and I've been using KMM on a couple of projects for more than a year now. It's really a powerfull technology which allows teams to move faster, but there are downsides, for example lack of native Swift interop, though there are opensource tools trying to solve this [2].

[1]: https://github.com/Kotlin/kmm-production-sample/tree/master#... [2]: https://github.com/touchlab/SKIE

Re: Kotlin Multiplatform for Android and iOS Apps

#60
post #4

With significant advancements in AI technologies, including solutions like ChatGPT/Bard, I am considering this issue of multi-platform from a standpoint of AI. If an application has been developed for a major platform, adapting the same applications for other platforms could potentially be managed by Co-Pilot. For instance, I can already create applications with the assistance of ChatGPT.

I’m gonna wait for them to be able to solve a sudoku first, before daring to give them any non-toy code.
Post reply on HN