Brian Lovin
/
Hacker News

Is Kotlin Multiplatform Replacing Flutter?

In recent times, the debate surrounding Kotlin Multiplatform (KMM) and Flutter has intensified, with some suggesting that KMM might supersede Flutter as the go-to solution for cross-platform mobile development. But is this truly the case?

Daily Digest email

Get the top HN stories in your inbox every day.

kbcool

Since when was Flutter the "go-to solution for cross-platform development"?

Maybe for hobbyists but in the corporate space it's still React Native.

The problem with Flutter, and this extends even further with KMP is that the scope of your skills is limited to making mobile apps whereas with React Native you are learning and using skills that can apply to a complete stack.

KMP is even worse in this regard as they expect you to build two frontends (yes I'm aware of compose multi platform but it's a separate product entirely) so unless you have some crazy business logic that Dart or JavaScript can't handle you're sacrificing the largest benefit in cross platform app development for the smallest.

As for whether Google are replacing Flutter I think they made a massive PR goof with the launch and have introduced a lot of uncertainty. Possibly it's their long term plan but currently it's just a tiny niche product.

ratg13

All you have to do is google Flutter vs React Native

The trend for Flutter is a straight line going up and React Native is going down in popularity.

The trend was obvious many years ago, and just recently Flutter is now surpassing RN in nearly every poll.

kbcool

This old myth is as old as the RN vs Flutter debate itself and I'm willing to help bust it again.

The simple answer is that when people have a problem or question about Flutter they simply key in Flutter. With RN they can ask about React, JavaScript, typescript, RN itself or one of the many components you use to make an app as it's the sum of a lot more parts.

So if Flutter didn't get more searches here I would be surprised and concerned.

The longer answer I'll just tease but suffice to say it's more complex than above.

It can come down to lots of things including the competency/experience of developers and maturity. As an experienced developer I might need to search for or ask about what I'm doing maybe 2 times a week. For someone getting started that might be that many times an hour. If you just looked at the two of us as a blob it might seem that whatever the other is using is more popular despite it being 50/50.

So yeah, number of searches or stack overflow questions or Reddit posts or whatever it is does not equal popularity.

ratg13

Reworded, your claim is that RN developers are getting smarter over time, need to search less, and that new developers don't have questions, they just figure it out .. and some mix of reasons like this are why the RN searches are going down.

I imagine I am having a harder time swallowing this logic than you are looking at raw numbers.

akmarinov

The trend for Flutter is 10 to 50 apps, the trend for React Native is in the thousands

zerr

Unlike RN, Flutter is desktop worthy.

wg0

Hardly. Performance lags. Even after the new rendering engine. Try compiling and then running desk top samples (a mail client, a finance management tool) on macOs and check the amount of jank in animations.

Text fields are whole another story. They feel alien in UX on every platform.

I can live with that but performance is a deal breaker.

bschwindHN

Yep, Flutter performance absolutely _sucks_ on older hardware, which they obviously aren't testing on.

chipweinberger

Wow I have not had that experience on macOS.

MacOS support is so good that I've developed a MacOS app just for convenience so I don't need to open the iOS simulator.

jamil7

Eh, I was recently contracted onto a native macOS team (Swift), the company had an adjacent desktop team who opted to use Flutter, they had a lot of problems and ended up dropping the project. I don't know the details but there was a lot of weird edge cases they ran into on desktop. They had a mobile app partially in Flutter (different team again) which seemed to be OK, however.

netdur

The problem with Flutter is that it's a UI framework that relies on a single main thread. If you put something heavy there, you'll get lag. In contrast, other languages like SwiftUI let you easily spawn threads. Flutter dismisses this as outdated and instead promotes an isolated model with completely separate memory... for reasons.

akmarinov

Unlike Flutter, React is web worthy

zerr

React Native for Web is not quite React.js as I understand.

aloha2436

> The problem with Flutter, and this extends even further with KMP is that the scope of your skills is limited to making mobile apps whereas with React Native you are learning and using skills that can apply to a complete stack.

I mean, Kotlin on the backend is quite good in my experience, I would say you can definitely run a full stack off of it.

inscrutable

One datapoint is that Google rewrote their Google Docs app in KMM (which doesn't include UI, that's Compose Multiplatform), replacing their legacy in-house framework. They intend to write more of their apps in it.

They also recently offshored some Flutter roles which may be a sign of how central they view Flutter. In a few years it may be in the graveyard.

https://touchlab.co/KMP-at-google

https://www.reddit.com/r/FlutterDev/comments/1chwqtu/flutter...

Alifatisk

> They also recently offshored some Flutter roles which may be a sign of how central they view Flutter.

No, Google did this throughout every team, not only the Flutter team.

lewisjoe

> One datapoint is that Google rewrote their Google Docs app in KMM (which doesn't include UI, that's Compose Multiplatform)

Can you point me to the source? I'm curious

inscrutable

https://developers.googleblog.com/en/google-kotlinconf-2024-...

For the name of the internal framework, I can't remember which podcast I heard it on, but they haven't mentioned it publicly much if at all. It's something they threw together in like 2012.

ratg13

The roles that were moved were devops stuff, nothing to do with core flutter, and they did this to many groups.

inscrutable

ok, this may be a red herring.

Still, in a couple of years when Compose Multiplatform is mature, and Google is looking to boost profit margin, they may rationalise their investment in multiple Cross Platform toolkits. I think most agree that, from a technical viewpoint, KMP + Compose Multiplatform offers the most flexibility.

matharmin

My team publishes a cross-platform library/SDK with support for Flutter, React Native, Web and KMP.

Right now, we're seeing a lot of interest in Flutter for new cross-platform apps. I personally find it a really pleasant development experience.

We're also seeing a lot of interest in React Native. In our case possibly less than Flutter only because there is more competing libraries available for React Native.

We're also seeing interest in KMP, but much less than Flutter or React Native - I'd guess it's probably 5% or less of our users. It may have a good future, but it's not there yet in terms of current usage.

zuhsetaqi

How big is your user base?

matharmin

It's fairly new, but at a couple hundred apps. Lots of indie developers, as well as a couple of larger companies.

scrp

To resolve the long-standing issues of naming inconsistency and abbreviation confusion that have puzzled many Kotlin developers over the past two years, we are deprecating the “Kotlin Multiplatform Mobile” (KMM) product name. From now on, “Kotlin Multiplatform” (KMP) is the preferred term when referring to the Kotlin technology for sharing code across different platforms, regardless of the combination of targets being discussed.

From: https://blog.jetbrains.com/kotlin/2023/07/update-on-the-name...

dualogy

Not sure... for some types of apps they might "compete" but for many not, I think: I view (after some toying with Flutter) the GPU UI renderers ala Flutter, QT/QML, gioUI, slint.dev etc as modern Flash-like options in a "can do anything graphically you could do with HTML+CSS+JS, which isn't the prime choice for some devs or some apps or those that don't want to have to end up with Ionic/Electron" manner — whereas KMM likely (my vague assumption) abstracts the common native GUI components shared among all platforms, plus allow platform-specific special ones too, I suppose? Or is KMM also going for custom GPU rendition?

Flutter & co. might just much more emphasize their graphical / fully-brandable nature rather than focus on their always-catching-up-and-slightly-off apings-of-native-UX.

If my KMM assumptions are somewhat correct, then it'll probably eat some of Flutter&co's lunch but not that much of it..

mike_hearn

KMM has two ways to do UI. You can do it natively and use Kotlin only for shared business logic (it inter-ops with Swift/Objective C). Or, you can take the new Android UI toolkit (Jetpack Compose) and it use it on desktop/iOS/web as well, for your whole app.

mdhb

Dart also has native interop with Swift, Objective C, Rust, C, Java, Kotlin and JavaScript.

It also has more compile targets as far as I am aware too. On top of the standard web, iOS, macOS, windows and Linux across all the standard chipsets plus emerging ones like RISC-V plus it also has support for WASM.

I don’t know of anyone with that level of cross platform and cross language interop out there currently which is also something you would want to write significant business logic or UI in.

mwcampbell

Still, for cross-platform mobile and desktop apps, the Dart website recommends Flutter with no qualifications, and Flutter only covers the approach of a single cross-platform UI, as opposed to native UI with a cross-platform backend. The fact that Kotlin officially supports the second option makes it more appealing to me.

isodev

There is also a webview based approach, like https://v2.tauri.app/ which comes with all the upsides of creating a lightweight HTML+CSS+JS UI but instead of shipping copies of chromium, it runs using the system's webview browser engine.

dualogy

Oh yeah by "Electron" I meant "and its alternatives" such as Tauri, Wails, github.com/webview etc.

isodev

Flutter has the challenge that it requires a dedicated language (Dart) and ecosystem to execute "on top" of each native platform it aims to support. Flutter skills can only be used to build Flutter things.

Kotlin Multiplatform (KMP) on the other hand, as the name suggests, allows one's knowledge in Kotlin/Android/JVM (a vastly bigger and more established ecosystem) to be used for building cross-platform apps.

KMP's focus is on reusing "logic" while implementing each platform's UI using the platform specific framework (SwiftUI and Jetpack Compose for mobile). I see this as a big advantage as well, as it allows apps to keep up with each platform and feel "at home", instead of landing with an "averaged" experience.

So yes, KMP is a more sustainable path forward.

esafak

It depends on which platforms interest you, but the general lack of multiplatform Kotlin libraries makes me doubt this will happen any time soon. I tried and gave up on Compose Multiplatform after realizing this for my most recent project, last year. (I went web instead.)

muzani

We've tried doing both. It's unlikely we'll use KMP/KMM.

1) We weren't happy with the layers in between - there's the cross platform and the 3rd party libs. 2) The exported size was about 30 MB bigger than it could be, mostly related to the previous point.

The main advantage it has over Flutter is that you don't have to learn Dart and Google won't kill it. But Dart is a nice language and it plays better into reactive programming than Kotlin.

undefined

[deleted]

wruza

Who may have thought in 2004 that 20 years later you may have to use a specific language and a specific ui library to run gui on different platforms without 500mb runtime and it still stuttered.

Why are we like this? It’s literally 66% more APIs that you need to support since then, everything else is already done. Take GDK/Cairo or Qt abstraction layers, integrate it with platform-specific smooth scrolling api and paint whatever widgets you want efficiently. Even proxying it to html-css would do the trick, although for a price.

cess11

I wouldn't know, but the experience I've had with Flutter as a dependency is that when a company has been struggling for a year, eighteen months, and topples and ends up on my table I usually need to tell prospective buyers that the mobile application is going to need maintenance before they can get the 'stores' to accept it and they can relaunch the system.

It also seems relatively difficult to find developers compared to React Native, which otherwise seems to share those maintenance requirements.

pjd7

I'm not a frontend engineer or really a fully experienced backend engineer. I have done systems stuff, lots of OPS, scaling and other things adjacent.

Flutter is interesting to me because I can use a tool like flutterflow to build an app and throw together the backend reasonably comfortably (with some possible future footguns included).

Not knowing Kotlin means this is less attractive to me, but I can see the benefit if I knew one language that could span frontend and backend very nicely.

Daily Digest email

Get the top HN stories in your inbox every day.

Is Kotlin Multiplatform Replacing Flutter? - Hacker News