Why doesn't flutter.dev use flutter as their front end?(flutter.dev)
flutter.dev
Why doesn't flutter.dev use flutter as their front end?
https://flutter.dev/
36 comments
Linux support is fine, I test my phone apps using the Linux build.
Dart has changed a lot since it was released, it has null safety now for example, you can put if and for inside a list constructor which helps when building widget trees. I like it a lot more than JavaScript.
Its biggest weakness IMO is a lack of data classes, considering you spend a lot of dev time building classes that just have properties and a toString(), toJson() and equality test. The code generator functionality is quite verbose as you need to run it manually. Both of these things are being worked on though, along with pattern matching.
Dart has changed a lot since it was released, it has null safety now for example, you can put if and for inside a list constructor which helps when building widget trees. I like it a lot more than JavaScript.
Its biggest weakness IMO is a lack of data classes, considering you spend a lot of dev time building classes that just have properties and a toString(), toJson() and equality test. The code generator functionality is quite verbose as you need to run it manually. Both of these things are being worked on though, along with pattern matching.
As someone who's used C, C++, Obj-C professionally, with some JS and Python.
Dart does most things right. It's heavily C# inspired. I enjoy using it.
Dart does most things right. It's heavily C# inspired. I enjoy using it.
But Dart can't do basic functional things like ADTs or pattern matching and has no pipe or composition operators. That puts it in the no-go category for me—and by proxy I never looked at Flutter.
These are the number one things keeping me from jumping into Flutter. Flutter is very attractive, but I always pause at Dart coming from F#.
Good news. It’s about to land. One nice thing about Dart is that they are extremely transparent in how they design the language. You can check out the entire repo here for an example of what I mean but if we are talking about these specific features this is a good place to start
Here is the intro:
https://github.com/dart-lang/language/blob/master/accepted/f...
Here is the spec of what they are currently implementing:
https://github.com/dart-lang/language/blob/master/accepted/f...
I think they both serve as a really good example of the kind of thoughtful approaches the language team are known for which coming from some different language communities previously I wasn’t accustomed to.
Here is the intro:
https://github.com/dart-lang/language/blob/master/accepted/f...
Here is the spec of what they are currently implementing:
https://github.com/dart-lang/language/blob/master/accepted/f...
I think they both serve as a really good example of the kind of thoughtful approaches the language team are known for which coming from some different language communities previously I wasn’t accustomed to.
Thank you for the links! That's exciting, although I'm cautious since it wasn't built around pattern matching.
I do know there is already some basic work on Fable having a Dart/Flutter backend, but I haven't used it.
I do know there is already some basic work on Fable having a Dart/Flutter backend, but I haven't used it.
Good to hear. This could make Dart a compile target candidate for a number of languages whose ergonomics better match these concepts, while having good native support from the language.
I've built lightweight things for my own use. I like Dart as a language and performance is adequate, I'm not building Fortune 500 level services. For me Dart covers all the basics while having a syntax that took literally no time to learn.
I have no problems with Linux support, at least for things that I do (file io, sqlite, http requests) but one thing that is giving me the pause is inability to cross-compile. It'd be super-duper if I could compile on my Mac and just drop the binary to my Linux server but I can't.
I have no problems with Linux support, at least for things that I do (file io, sqlite, http requests) but one thing that is giving me the pause is inability to cross-compile. It'd be super-duper if I could compile on my Mac and just drop the binary to my Linux server but I can't.
I would hope Linux support is decent since Ubuntu is supposed to be adopting Flutter as their default choice for UI https://ubuntu.com/blog/bring-multi-platform-apps-to-linux-d...
Where do you see that Ubuntu is adopting Flutter as default? That link is an announcement for the latest version of Flutter, which supports building Linux apps, and that Canonical helped make happen, but I don't see a mention of it becoming the default toolkit.
Here, this link explicitly says it https://ubuntu.com/blog/flutter-and-ubuntu-so-far
>making Flutter the default choice for future Canonical mobile and desktop apps.
The other link was more up-to-date about the state of Flutter on Ubuntu though.
>making Flutter the default choice for future Canonical mobile and desktop apps.
The other link was more up-to-date about the state of Flutter on Ubuntu though.
Ugh, thanks.
Canonical can't seem to escape bad strategic and technical decisions. They're still pushing Snaps, and now settling on a default tech stack that might disappear whenever Google gets bored of it.
Canonical can't seem to escape bad strategic and technical decisions. They're still pushing Snaps, and now settling on a default tech stack that might disappear whenever Google gets bored of it.
Google is also making Flutter the de facto UI solution in their upcoming Fuchsia general purpose OS. It also is powering their single biggest money maker (Ads). It’s an absolutely core part of their future strategy with almost zero chance of disappearing like you described. I imagine Canonical also got the same assurances in writing before making that decision.
You might be right, but Google choosing to use it in Fuchsia doesn't inspire much confidence, given Fuchsia's rocky and lengthy development. I wouldn't be surprised if Fuchsia itself is abandoned, given Google's track record.
I wouldn't quite be sure it has an "almost zero chance of disappearing", but hopefully Canonical has done their due diligence before making such a decision, as you say.
Though, even if it does become a long-term Google project, I'd be concerned that any Flutter app on Ubuntu would have aggressive tracking. Considering their announcement of integration with FlutterFire Auth, it's only a matter of time before something like Google Play Services makes its way into desktop apps as well. Canonical's record of protecting user privacy is already far from stellar.
I wouldn't quite be sure it has an "almost zero chance of disappearing", but hopefully Canonical has done their due diligence before making such a decision, as you say.
Though, even if it does become a long-term Google project, I'd be concerned that any Flutter app on Ubuntu would have aggressive tracking. Considering their announcement of integration with FlutterFire Auth, it's only a matter of time before something like Google Play Services makes its way into desktop apps as well. Canonical's record of protecting user privacy is already far from stellar.
> Shouldn’t clicking the link answer the question?
you're right, I probably should have prepended "Ask HN:"
you're right, I probably should have prepended "Ask HN:"
An example of a UI toolkit that does do this is https://jpro.one which renders JavaFX apps to HTML. They use it for their whole website and even their documentation. It works fairly well except if you go offline and lose the connection to the server.
[deleted]
Flutter's days are numbered - iOS continues to grow. More and more companies won't bother with Android given how poorly Google has managed that OS.
As a long time professional mobile engineer, that has worked on all three of Android, iOS and Flutter. This is plain wrong.
Flutter is a brilliant framework, despite what hardcore native devs of either platform might tell you. It has it's flaws, but the speed of its improvement and its usability as a cross-platform framework is probably the best on the market.
That combined with being able to just code native Android or iOS if you really have an issue you can't overcome make it quite powerful.
You're also plain wrong about Android. It is by far the largest platform in every country outside the first world, and is not going anywhere. You just have to look at Asia, Africa and South America to understand that around half the world use it.
Flutter is a brilliant framework, despite what hardcore native devs of either platform might tell you. It has it's flaws, but the speed of its improvement and its usability as a cross-platform framework is probably the best on the market.
That combined with being able to just code native Android or iOS if you really have an issue you can't overcome make it quite powerful.
You're also plain wrong about Android. It is by far the largest platform in every country outside the first world, and is not going anywhere. You just have to look at Asia, Africa and South America to understand that around half the world use it.
While iOS continues to grow, so does iOS development using Flutter :)
I believe that iOS users tend to favor apps with beautiful designs, and Flutter's blank canvas gives developers the ability create expressive and unique UIs. If you're looking for an example check out Wonderous.app
I believe that iOS users tend to favor apps with beautiful designs, and Flutter's blank canvas gives developers the ability create expressive and unique UIs. If you're looking for an example check out Wonderous.app
I doubt it. You can't just look at the smartphone market share in the US or a few wealthier countries.
[deleted]
Because it isn't an app? (and web still is kinda a side thing for flutter - you can do it, but it's not the thing)
"Flutter transforms the app development process. Build, test, and deploy beautiful mobile, web, desktop, and embedded apps from a single codebase."
"The second thing" is pretty close to "the thing".
"The second thing" is pretty close to "the thing".
Well yes, although I would reorder in terms of support/completeness:
mobile/desktop/web/embedded
mobile/desktop/web/embedded
"Test" is the second item in that list
I care more about what's happening in practice than marketing speech semantics.
“web … apps”
Great question!
While we'd love to be the best solution for every problem, it turns out the HTML-based web has been highly optimized for decades for text-heavy, linear, reading experiences.
So we're staying focused on the places where Flutter does the best job: interactive, non-linear, more-create-than-consume.
So our sites use HTML & CSS: flutter.dev, dart.dev, pub.dev
And our devtools are built in Flutter Web: https://docs.flutter.dev/development/tools/devtools/overview Along with web experiences from rows.com, reflection.app, rive.app, supernova.io, and many more.
FYI: I'm the product manager working on Flutter and Dart web tech at Google
(edit: fixed domain, mis-added one app)
While we'd love to be the best solution for every problem, it turns out the HTML-based web has been highly optimized for decades for text-heavy, linear, reading experiences.
So we're staying focused on the places where Flutter does the best job: interactive, non-linear, more-create-than-consume.
So our sites use HTML & CSS: flutter.dev, dart.dev, pub.dev
And our devtools are built in Flutter Web: https://docs.flutter.dev/development/tools/devtools/overview Along with web experiences from rows.com, reflection.app, rive.app, supernova.io, and many more.
FYI: I'm the product manager working on Flutter and Dart web tech at Google
(edit: fixed domain, mis-added one app)
> HTML-based web has been highly optimized for decades for text-heavy, linear, reading experiences
If browsers offered a lower level graphics API, would that give a significant performance improvement over canvas?
What is the performance bottleneck for flutter web? Is it the overhead of drawing to the canvas, or dom tree optimization?
I'm very interested in this topic.
If browsers offered a lower level graphics API, would that give a significant performance improvement over canvas?
What is the performance bottleneck for flutter web? Is it the overhead of drawing to the canvas, or dom tree optimization?
I'm very interested in this topic.
(disclaimer: I work on Flutter Web)
It's mostly about algorithmic trade-offs. When you know your content layout is static and is highly biased towards vertical scrolling, you take different kinds of performance trade-offs, such as pre-computing and caching layout and painting output. Like when you know your array is sorted, you can use binary search to find an element instead of scanning. When pages do invalidate HTML layout you will actually see very bad jank. This is one of the classic performance pitfalls on the web, even using "classic" frameworks, like React or Angular. Flutter's current widgets and rendering primitives are biased towards dynamic content, where over-computation like this would hurt performance when you layout or paint isn't stable. Instead, we optimize for volatile content, using tricks like lazy rendering and repaint boundaries. We can still add primitives needed to render static content efficiently. We just feel like we're not yet sufficiently done with the non-static case.
It's mostly about algorithmic trade-offs. When you know your content layout is static and is highly biased towards vertical scrolling, you take different kinds of performance trade-offs, such as pre-computing and caching layout and painting output. Like when you know your array is sorted, you can use binary search to find an element instead of scanning. When pages do invalidate HTML layout you will actually see very bad jank. This is one of the classic performance pitfalls on the web, even using "classic" frameworks, like React or Angular. Flutter's current widgets and rendering primitives are biased towards dynamic content, where over-computation like this would hurt performance when you layout or paint isn't stable. Instead, we optimize for volatile content, using tricks like lazy rendering and repaint boundaries. We can still add primitives needed to render static content efficiently. We just feel like we're not yet sufficiently done with the non-static case.
Interesting, that makes perfect sense from the perspective of working with existing browsers. I think it's awesome that the flutter team is making canvas work.
But what I'm curious about is why an average consumer laptop can render a game with 3D projection, PBR, physics, and multiplayer networking, made by a newbie in a game engine. But that same laptop struggles to render a webpage. Even an extremely complex and content-heavy webapp is nothing compared to a game.
There has to be a bottleneck other than dom optimization, right? Like I mentioned before, canvas painting must have huge overhead...
But what I'm curious about is why an average consumer laptop can render a game with 3D projection, PBR, physics, and multiplayer networking, made by a newbie in a game engine. But that same laptop struggles to render a webpage. Even an extremely complex and content-heavy webapp is nothing compared to a game.
There has to be a bottleneck other than dom optimization, right? Like I mentioned before, canvas painting must have huge overhead...
Many modern web pages are extremely bloated. Consider all the videos on an ad-heavy website. Often there are hundreds of http requests.
A beginner’s video game will be relatively lightweight in the sense of not having a lot of large assets, and what they have is pre-loaded.
A beginner’s video game will be relatively lightweight in the sense of not having a lot of large assets, and what they have is pre-loaded.
I agree, they're terribly bloated.
> A beginner’s video game will be relatively lightweight
What I meant by this point is that a newbie wouldn't know how to optimize their game, yet it performs better than many webpages
> A beginner’s video game will be relatively lightweight
What I meant by this point is that a newbie wouldn't know how to optimize their game, yet it performs better than many webpages
What about the initial load time? Browser's don't have a Flutter client built in.
I know there's been a lot of good work in reducing this, lately my Flutter web app loads much faster, but it wouldn't get a great Pagespeed rank. That's why I link to it from the main HTML/CSS site.
I know there's been a lot of good work in reducing this, lately my Flutter web app loads much faster, but it wouldn't get a great Pagespeed rank. That's why I link to it from the main HTML/CSS site.
—edit—
And since there’s flutter devs here, how is dart as a general purpose programming language?
I’ve looked into it a couple times but never really too hard because it didn’t seem like the Linux support was all that good, probably changed now though.