I really do believe in flutter's future though. Developer experience has been a blast. coming from iOS I've saved so much time with hot reload
Flutter 2
351–360 of 780 posts
Re: Flutter 2
#352Earlier quoted context omitted.
>Dart makes Typescript look like a joke. Dart still does not even have union types, probably the best feature of TS. I would hold off on that claim for now..
What is your main use case for type unions? I don't know typescript, but I haven't felt the dart language was not feature complete for all my uses. Is this something you cannot solve with a combination of abstract classes, and or/extension? https://dart.dev/guides/language/extension-methods
But for me the main use for TS union types is to make discriminated unions, which is very useful wherever you have some form of a state-machine:
type AppState =
| { state: "loading", progress: number }
| { state: "selecting_level", }
| { state: "playing", level: Level }
| { state: "success" }
| { state: "failure", wantsRetry: boolean }
| { state: "error", reason: string }
(Small excerpt from a game we're developing at $dayjob)You can switch on that and the compiler will know what variant you're talking about, and it will apply exhaustiveness checks (ensures your code will handle all possible states)
Re: Flutter 2
#353Re: Flutter 2
#354We're all complaining about how js is a bad language, tooling is a mess, and how the web is fundamentally built for documents and makes it hard to create app-like experiences. Now, Google comes and creates a whole new UI toolkit from scratch, couples it with a very beautiful SDK and component framework and offers a far better programming language than js could ever be but we're still nagging. I was also pretty disapp…
I would not call the flutter SDK and component framework "beautiful" nor would I ever add the adjective "very". I have actually found it to be very verbose compared to alternatives I've used in the past. In some ways I suggest it is over engineered.
> offers a far better programming language than js could ever be
Dart is a bit of an odd duck language to me. I think of interesting ideas like the cascade notation (using .. to do sequences of operations on the same object).
Perhaps it is due to having worked a lot in Typescript and having my brain molded to code that fits that shape but Dart feels clunky in comparison. I can't put my finger on why, but defining and instantiating classes feels so heavy compared to the functional type code most Typescript seems to become. In Dart, I just feel like I'm creating massively indented component definitions with tons of properties and nested classes. Maybe I'm just finally accepting OOP and deep type hierarchies are things I want to leave to my past. I feel I can do 99% of what those things did with Algebraic types and functional composition. Nowadays I prefer that style and going back to heavy OOP feels bad.
With the dominance of classes, massive type hierarchies and quirky syntax - I'd just prefer to be working with a more react-ish framework in a language like Typescript. My feeling is Dart is a step in the wrong direction.
Re: Flutter 2
#355(disclaimer: I'm the author)
Re: Flutter 2
#356Earlier quoted context omitted.
I'm not sure, but I think that you have to use Dart language to use Flutter. Incidentally, I was pretty sure that Dart was dead. Turns out it's alive. I'm not sure what it is currently, now that it's statically typed, null safe and all. What are Dart's killer features?
What are Dart's killer features? Looks like we're discussing one - flutter?
Re: Flutter 2
#357Earlier quoted context omitted.
Maybe it's just me but I don't remotely think JS is a bad language since es6. Tooling is another story entirely.
JavaScript is 26 years old, people were calling COBOL old in the 90s, when it was 30+ years old. COBOL is still being updated, it even supports OOP now, yet it shows its age and its joints creak a little, just like JavaScript.
Re: Flutter 2
#358Earlier quoted context omitted.
Eh, it's a little murky. I was playing with dart a little. It can in fact create a single binary, but it looks like it's just putting the interpreter with the code. I say that because if you strip or pack the binary, instead of working it shows the output of running dart with no arguments.
[ disclaimer: I work on the Dart team ] It depends on how you run. Dart can either run in JIT mode or AOT mode. In general, when you ship a production app (e.g., for Flutter), you are using AOT - i.e., it's compiling to native machine code. In this case, there is no interpretation or compilation at runtime. We still bundle a runtime for garbage collection.
$ cat a.dart
void main() {
print("hello world");
}
$ dart compile exe a.dart
Info: Compiling with sound null safety
Generated: /home/x/a.exe
~ $ strip a.exe
~ $ ./a.exe --version
Dart SDK version: 2.12.0 (stable) (Thu Feb 25 19:50:53
2021 +0100) on "linux_x64"
If I run without --version, it prints the same thing the 'dart' command does.Re: Flutter 2
#359Re: Flutter 2
#360Earlier quoted context omitted.
We're nagging because the apps suck and stick out like a sore thumb. Maybe Flutter will be the one to get there and be the holy grail of cross platform UI development, but the developer community has been burned by this promise so many times, we're going to have to see the final product before getting excited. Just because a project is ambitious doesn't mean we should all jump on board, particularly when similar proj…
I don't understand why more resources aren't being put into Qt and making that easier to use or building a more "web-developer-friendly" abstraction layer on top.
At the time, they were making almost all of the same mistakes that Flutter is, and the devs I talked to seemed to be of the opinion that those problems wouldn't be fixed until browsers started adding brand new capabilities specifically for them.
Looking now at the demos at https://www.qt.io/qt-examples-for-webassembly, a lot of the same problems are jumping out at me. A complete lack of accessibility features, poor handling of scroll events, large load times, unfocusable fields, lack of keyboard controls, etc...
Halfway through playing with their pizza app, the page just froze and stopped responding to any clicks at all. Maybe those demos are outdated?
Blazor and Rust are showing a lot of promise here, but from what I know about Qt I'm much less optimistic, because Qt is used to handling everything about rendering itself -- and as Flutter is showing that's just not a good approach to building web GUI frameworks. But (again, purely from what I've seen) trying to layer on a system where Qt is actually interacting with the DOM seems like it would require a somewhat difficult shift in its architecture. Maybe I'm misunderstanding the problem though.