Flutter is going to be 5 years old soon. It's not even the leading solution for cross-platform development for mobile let alone desktop. It's great to be positive and supportive but realistically, if someone had to bet months of dev work on building something non-trivial - would they really choose flutter?
Flutter desktop isn’t there yet
201–210 of 242 posts
Re: Flutter desktop isn’t there yet
#202Earlier quoted context omitted.
Java, again, is not ahead of time compiled, or at least did not have a good solution for that ten years ago. Even Android apps now run as AOT compiled apps with Android Runtime (ART), discontinuing the Dalvik VM.
Java had AoT compilers for more than 20 years, https://en.wikipedia.org/wiki/Excelsior_JET If Google really wanted they could have wrote one.
There are AoT compilers for Java, but I'm not aware of any successful widely-used ones. Java and the Java ecosystem rely pretty heavily on class loaders and reflection which make AoT compilation very difficult. Java in its bones is designed to be a JIT VM language and you'll always be going against the grain if you try to statically compile it.
Dart was also initially designed to be a JIT VM language (by the same folks who made the HotSpot JVM) but without many of the pitfalls in Java that make AoT hard, and over time we have deliberately evolved the language (in breaking ways!) to make it much more amenable to static compilation.
Languages are not all interchangeable and some languages are better suited for certain implementation strategies than others.
Re: Flutter desktop isn’t there yet
#203A good example of Flutter desktop is https://rive.app/downloads - curious on others' thoughts of how that compares to Electron or other choices that are out there.
I tried it, it's quite snappy compared to Electron, I assume because it's AOT compiled.
Re: Flutter desktop isn’t there yet
#204Earlier quoted context omitted.
I’m not sure why the Dart hate honestly. It’s a pretty solid language in my opinion and I like the direction they’re taking (non-nullable, record, pattern matching). The ecosystem is weak for sure, but that’s not a gripe on the language itself. I’m curious what do you dislike about it apart from semi-colons and the constructor syntax (which seem fine to me?).
Okay I guess I should provide more details. Constructor syntax fine? Jesus how come you can't use the constructor parameters as the default values but have to either resort to using `late` or that weird `: {}` after constructor like in C++, can't remember how it was. I just added `late` and thought whatever. Probably there are nuances I've missed but how come you had to reinvent that - thought it should be intuitive…
This is a really good question. The reason is that it ensures that you can never see a field before it's initialized. In Java, you might think that you'll never observe a final field before it's been initialized but not so! In the constructor, you can call a method on `this` even before all fields have been definitely initialized. Inside that method (which might be overridden!), you can then read the field. It will be default initialized.
This means every time you create an object in Java, some extra code is running to default initialize all the fields just in case they get read before they're actually initialized. (I assume in some cases the compiler can prove it's not needed and eliminate it, but not in the general case).
It also means that the type system can't rely on fields being initialized for static safety. That in turn means that the compiler can't optimize based on that fact.
In Dart with the constructor initialization syntax, it's not syntactically possible to access any state on a new instance until after every single one of its initializers has run. That means that, in concert with null safety, if you have a non-nullable field, the compiler knows it will never ever be null and then can generate smaller, faster code based on that guarantee.
I agree the constructor initializer syntax is annoying and I wish we had something better, but it's there for a reason. Also, in practice, you often use `this.` or `super.` on the constructor parameters and avoid the initializers entirely.
> While stating itself to be statically typed you can also shoot yourself in the foot by simply using `as Type`, similar to TypeScript. Because that just assigns it to a type and doesn't cast it like you do it in say Rust.
An "as" expression is fully sound and will throw a runtime exception if the value isn't a valid instance of the cast type.
> The extreme use of classes with `abstract class` and whatnot feels kinda 90's to me, just a lot of abstractions and for what?
You don't have to use classes if you don't want to. You can define functions and variables all at the top level and write in a completely procedural or functional style if that's your jam. Some of the Dart packages I maintain are mostly functions.
> I think making it more functional would help it.
We're getting there. It's always had anonymous functions, closures, and plenty of higher-order functions in the collection API. We're adding pattern mataching and exhaustiveness checking now which should let you program in an algebraic datatype style.
Re: Flutter desktop isn’t there yet
#205Earlier quoted context omitted.
I’m not sure why the Dart hate honestly. It’s a pretty solid language in my opinion and I like the direction they’re taking (non-nullable, record, pattern matching). The ecosystem is weak for sure, but that’s not a gripe on the language itself. I’m curious what do you dislike about it apart from semi-colons and the constructor syntax (which seem fine to me?).
Last I checked you can’t even have enums with payloads/ associated values. Garbage language
Re: Flutter desktop isn’t there yet
#206Earlier quoted context omitted.
Google's Flutter team was affected by layoffs and we lost some wonderful folks. However, the number of Googlers working directly on Flutter has grown substantially in the last year. Please keep in mind that Flutter is a community project. Google is one of Flutter's many sponsors, many of our contributors are from other companies.
Thank you! That's reassuring and I strongly believe that Flutter is the best option for developing cross platform apps right now.
Flutter is unquestionably designed mobile-first, with everything else a distant second. Flutter may be the best option for developing cross-platform mobile apps right now (I don’t know), but if you care about web or desktop, it’s not a particularly good choice. Things based on web tech are very likely to be better.
Re: Flutter desktop isn’t there yet
#207Earlier quoted context omitted.
Is there a CLA? Do I have to waive ownership of my contributions for my code to be merged? If yes then it's not a community project. Domain ownership has little to do with it. Look at who owns github.com :)
CLAs are always a good idea if one is maintaining an open source project. I'm not going to track down every single contributor who made some small PR perhaps, just to make a license change.
Re: Flutter desktop isn’t there yet
#208Earlier quoted context omitted.
same here,keep up the great work. by the way dart is my favorite cross platform language nowadays beyond flutter.
I work on Dart, and I'm glad you like it. I always like getting feedback from users. If there was something you could change about Dart, what would you pick? What would you keep just as it is?
i've learned at least a half a dozen languages over the years, and dart is now my favorite. so much so that i am converting existing projects to it. for example, i have a series of scripts i wrote, in python, to automate away the boring parts of my job, which i am now converting to dart. at this point, for me, trying to get anything done in python is like wading through molasses. (like, why does almost any change to a python implementation file cause you to also have to revisit the imports section? ugh, i hate that so much.)
my number one change would be to add configuration options to the formatting tool you wrote. i can see why consistency is a virtue for large projects, but for me, it is strictly a hindrance. programming is thinking, and i really don't like you dictating the way i ought to think. (yeah, i know you won't do it, but that's my big one.)
my second big change would be to allow me to implement a big dart class in two or more implementation files. the business logic in the flagship flutter app i maintain is getting unbelievably complicated, and large chunks of it cannot be moved out of the one object it is in, due to inheritance reasons.
Re: Flutter desktop isn’t there yet
#209The Flutter team should consider unpegging from dart and utilize JavaScript/Typescript, Kotlin, or Swift.
We've been telling Dart team our complaints but they have been unaddressed for over 8 years now. At this point, some other thoughts include applying a garbage collection cycle and have them replaced by Carbon team or Golang team.
Perhaps get a new product manager, someone that will listen to the grieving (& dying) dart community.
Re: Flutter desktop isn’t there yet
#210Earlier quoted context omitted.
Fully native isn't especially realistic. At the risk of sounding like a broken record, general purpose tooling written by a small team can't support multiple native UIs. What often works for me is something like Wails, but it has its limitations. For instance there's no multi-window functionality there either, and while the new Wails supports more OS integrations there's still some aspects that need improvement to co…
Having worked on projects for both mobile platforms with small teams, I find that cross platform UI frameworks only really make sense for somewhat simplistic apps. The more involved the app in question is, the more these frameworks incur overhead with the extra surface area for bugs to occur on which is multiplied by the number of supported platforms. The story on desktop is a little better but the same principle app…