Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It does suck that Flutter doesn't have as much bandwidth for people working on it as I'd like, but I'm not sure there's much one can do short of directly contributing and sending PRs, which it seems the author of that issue has done for a temporary fix.


The "temporary" fix is to allow developers to disable the cursor animation, i.e deviate from the native look & feel.

After almost four years of saddling every Flutter app that uses text input with anywhere between 5% and 20% CPU usage, this is what they have come up with.

What this tells me is that it is neither possible nor beneficial to imitate native UI toolkits using a completely different technology stack. It's simply the wrong architecture.


Well, I guess there's no free lunch after all. At least it's better than Electron in that it's compiled code, and that it works on 6 different OSes.


I disagree. Web technologies are highly optimised for what they do (i.e text field uses 0% of CPU), run compiled code on all platforms and don't waste resources on chasing this unachievable and pointless native fetish.

I don't understand your position. You're saying (correctly I think) that most users don't care about native. But then you turn around and choose an immature technology that spends a significant share of its budget on trying and failing to imitate native.

The bug I cited betrays the priorities of the project. They chose to prioritise chasing "native" over fixing a critical bug for many years.

Also, look at the large amount of investment going into web technologies - WebAssembly, WebGPU and many others. Even much criticised Apple is putting in a lot of work. I don't think the completely isolated Flutter/Dart team will ever be able to compete.


And how are those web technologies going for the bloat of Electron? There is no free lunch.

Flutter binaries and runtime are orders of magnitude smaller and faster than web technologies. True, they shouldn't be chasing native, but it's still better than what we have currently with trying to cover 6 OS with web technologies.


Not sure why you keep harping on Electron. It's not even available on mobile and choosing to distribute an entire browser engine with every single app is not the same thing as choosing web technologies in general. The Dart runtime isn't any faster than V8 either.


My point is that web technologies are quite poor for building multi-platform apps, something which Flutter excels at, even as it has its own issues. I consider those a worthwhile trade-off. I don't understand the points you're making, first you talk about battery drain, fair, then you talk about native, but it seems like you're missing the fundamental benefit of why some devs choose Flutter, which is that it works everywhere you need it to, and fairly fast, too. People use Electron for this generally, so that is why I brought it up, and I am saying that Flutter is a better alternative to Electron and other web technologies, and I am not sure exactly what you mean by web technologies, but I colloquially understand that to mean HTML, CSS, and Javascript. They are good at things like text rendering at 0% CPU precisely because they've been honed over decades, something which Flutter has not yet been able to.

The compiled code from Dart is faster than V8, even simply by virtue of being AOT compiled instead of JITed, not sure where you saw that it wasn't any faster. Also, web technologies do not run compiled code on every platform, they don't run compiled code on any platform, I'm also unsure of where you're making that claim from, unless you're talking about WASM which is still a ways away, and something that Flutter leverages too already (see their work on pushing WASM GC as well as their experimental build of Flutter Web with WASM GC), so it's not unique to web technologies like HTML, CSS, and Javascript.


I've had a decent experience building a webapp that can be used on the browser, and with some light packaging on the desktop and on mobile without being a full on electron app (webview instead).

At the moment it's a different tech stack for packaging mobile vs desktop app, but I'm waiting for Tauri to implement support for mobile to migrate everything to Tauri (I'm using a go webview library for desktop and capacitor for mobile).

Note: I know devs are usually allergic to multiple techs far various targets, but it was pretty much a one-off time cost, 99% of the dev time is spent working on the webapp itself.


>My point is that web technologies are quite poor for building multi-platform apps, something which Flutter excels at, even as it has its own issues. I consider those a worthwhile trade-off.

I have come to the exact opposite conclusion starting out with an open mind just like you. Flutter seems like a quixotic effort to me. Bugs like the one I linked to are a confirmation of that.

>Also, web technologies do not run compiled code on every platform, they don't run compiled code on any platform, I'm also unsure of where you're making that claim from.

JIT compiles to native code. WebAssembly is another option.

>not sure where you saw that it wasn't any faster

https://programming-language-benchmarks.vercel.app/dart-vs-j...


How would you make cross platform apps using web technologies, including mobile, desktop and of course web? I've tried a lot of web-based frameworks like Capacitor, Ionic, Cordova and even React Native (which isn't necessarily web tech as it's just a DSL to call out to native components), and I haven't really been impressed with either the performance or UX of any of them. They all feel (except RN) like you're using a website, not a native app, which is because that's basically what you're doing.

Thanks for the benchmarks, seems they're about even.


>They all feel (except RN) like you're using a website, not a native app, which is because that's basically what you're doing.

I mean, it really depends on the specifics of your app. For most apps it wouldn't hurt one bit if they were just good mobile websites or PWAs (possibly packaged for app store distribution).

For computation heavy code WASM is becoming a viable complement to JavaScript. WebGPU is on the way. And Figma has just sold iself to Adobe for $20bn after annihilating native competitors (I realise I'm painting in very broad strokes here).

I think there is a niche for mostly client side, offline-first apps that still have no need for deep integration with the native platform and are not games. But it's a small niche getting smaller.

The technogies living in this space will forever be changing, falling out of favour only to be replaced by the next attempt. It's been going on like this forever (Java Applets, Swing, Flash, Xamarin, ReactNative, Flutter...) It's not something I want to build a business or a career on.

But I guess if Flutter works for you and your users right now then why not.


Technologies like Flutter, Blazor, Rust GUIs that similarly draw to the canvas etc also are all leveraging WASM and WebGPU too though, so I'm not sure how much benefit there is on using the pure web for stuff like this. Even Figma's main canvas editor is written in C++ and some Rust, it's not using Javascript. I expect that if WASM and WebGPU become mainstream, people will simply use their programming language of choice and render to a canvas via WASM, and be able to port that to mobile and desktop. This is basically what Flutter does anyway so it's ahead of the curve of what you're predicting.

True, some apps could be packaged websites, but you will always be able to tell. The Twitter app is one example, and it's definitely not as smooth as 3rd party native apps, or even those made by React Native or Flutter. I simply consider PWAs a bad user experience based on the many I've tried.


It's incorrect to say AOT is always faster than JIT (without profile guided optimization). And it's reasonable to call jit-eligible code sometimes compiled.


Client apps are most of the time not long running processes where JIT could reach steady state performance and startup time is important. So in practical terms, AOT is faster than JIT majority of time in this use case.

Also, look at this benchmark where native image PGO is now outperforming JIT in peak throughput: https://medium.com/graalvm/graalvm-for-jdk-21-is-here-ee0117...


That is true, I (and the parent) should not have made claims either way about their respective speeds without thorough benchmarks.


> What this tells me is that it is neither possible nor beneficial to imitate native UI toolkits using a completely different technology stack. It's simply the wrong architecture.

IMHO, UI toolkits based on low level technology stack are the future. It just that they are massive undertaking. It's not impossible to implement cursor animation with low CPU usage.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: