Live data from Hacker News

Dart/Flutter now has macros/metaprogramming

github.com

91–100 of 129 posts

Re: Dart/Flutter now has macros/metaprogramming

#91
post #33

Earlier quoted context omitted.

>Why would I use it over something like Rust, Go, or even JavaScript? Honestly, mainly for flutter. But if you do chose flutter for your project, you will suddenly wish everyone was using dart for everything else instead of Java on android, or c#/Swift on ios ect. if that makes sense. If sound type checking is truly feasible on the web then I'd say dart should be there too. But I can't say if that's really the case.…

I think Dart really suffered from missteps in the early days. Originally, Dart didn't seem like anything special and it kinda wasn't. It was a dynamic language where optional type hints were suggestions and it'd be run in a VM just like JS and seemed like JS with some slight differences. It feels like Dart became a completely different language that just happens to have the same name. It's now statically typed, has A…

On top of that, it was AdWords team that kept Dart 1.0 alive, while Flutter made Dart 2.0 happen.

It isn't much beyond Flutter making Dart relevant, other than the folks that decided to rewrite Sass into Dart I guess (I wonder when A RIIR will happen, like most JS tooling nowadays).

Re: Dart/Flutter now has macros/metaprogramming

#92

Earlier quoted context omitted.

I'm not really sure where it slots in in a world with a lot of programming language choices. Why would I use it over something like Rust, Go, or even JavaScript?

> Rust Dart has a GC. > Go Dart has exceptions. > JavaScript Dart is statically typed. --- Plus....Dart has a first-class mobile story, unlike Rust + Go. --- Hope that helps!

> Dart has a first-class mobile story, unlike Rust + Go

Not really, the Android team doesn't even list it as supported language, a team that belongs to the same employeer.

The same team not only lists Rust, it has official documentation on the Android site for OEMs, on how to use Rust.

Re: Dart/Flutter now has macros/metaprogramming

#93

I really love the engineering that has been put into dart/flutter and the innovation it has brought to native UI development, but I just can't justify using it for anything. The ecosystem is immature and anything I would use it for could just as easily be written in Kotlin or JavaScript (TS).

Or Swift I might add. For me, Flutter is code bloat in comparison with Swift. Swift is doing a great job of reducing the code you need to write, lots of syntactic sugar. I only compared few basic apps like Hello World and Buttons, but the difference in code to write was stunning to me. Flutter also resembles React in this regard to me. Lots of bloat instead of syntactic sugar like for example in Angular.

You might find the following two reddit threads enlightening, as they talk about Flutter's verbosity:

https://www.reddit.com/r/FlutterDev/s/kKVzkvpnlj

https://www.reddit.com/r/FlutterDev/s/RyBQaLBeuS

Tldr, it's a different philosophy between Flutter and Swift, of explicit being more useful that implicit, and of performance optimizations that can be made due to that. The second thread has the tech lead of Flutter responding to the claims.

Re: Dart/Flutter now has macros/metaprogramming

#94
post #58

Earlier quoted context omitted.

> 45% on an intel core on a linux desktop Just tried it out. 3-5% in debug build. 0% on release build.

Let me guess, you did a TextField, not a CupertinoTextField ? (It's 20% on release for me, still too much for a blinking cursor). Sure there may be some simple pathological bug in that one widget, but this quality issue in a fundamental widget in the official kit just does not give me the warm fuzzies, especially looking over the the github issue tracker. And yes I am biased because it is google and they hardly dog f…

Simple CupertinoTextField

Re: Dart/Flutter now has macros/metaprogramming

#95
post #75

Earlier quoted context omitted.

How's scrolling on iOS? Are you using the new rendering engine?

My app has lots of complex heterogeneous scroll views and performance is great on iOS (with impeller).

Thanks, I'll give it another chance when the impeller stuff settles more.

Re: Dart/Flutter now has macros/metaprogramming

#97
post #95

Earlier quoted context omitted.

My app has lots of complex heterogeneous scroll views and performance is great on iOS (with impeller).

Thanks, I'll give it another chance when the impeller stuff settles more.

I think at least on iOS it's stable enough to use now. I'm also not having any issues with it on macOS. Android impeller still seems to have some bugs.

Re: Dart/Flutter now has macros/metaprogramming

#98

I hope Dart gets more support, I really want alternatives to TypeScript for developing webapps which aren't super "bulky" (slow startup, buggy and hard to debug) and support mobile apps. Dart seems to be the best at both although I haven't used it much. It also seems reasonable (one of the reasons I don't like TypeScript is because it still has some quirks from JavaScript like `===`, also because the types are occasi…

> I really want alternatives to TypeScript for developing webapps which aren't super "bulky"

I hear you, but what do you expect Dart's contribution as a language/technology to be in this space, effectively? While syntactically comparable, TypeScript is a better typed JavaScript than Dart will probably ever be (in terms of leveraging a type system to enable more complex/maintainable apps and libraries). And since every programming language compiles to JavaScript these days, you've got some compelling options if you really want to depart from JS altogether (with http://www.scala-js.org/ an amazing one, for which I find the mix of Functional + Object Orientation to lend itself very well to the web).

In all, I really fail to see a good reason for Dart to exist nowadays (and surviving as "Flutter's best language buddy" isn't a great one).

Re: Dart/Flutter now has macros/metaprogramming

#99
post #85
post #65

I see a couple of comments regarding frame rates on load. The Flutter team claims they addressed that with their new rendering engine. Has anyone found this not to be the case?

I'm working on an app that is running on the latest version of Flutter with Impeller enabled. The performance seems good as long as you do not embed platform views inside a list. However, when you drop even a single platform view (web view, video player, google ads...), the performance drops to unacceptable levels even on the latest iOS devices. This is related to another issue with the Flutter ecosystem, it has clos…

You might be interested in Compose Multiplatform, it's from JetBrains and is a combination of Jetpack Compose and Kotlin Multiplatform. You can transparently use both platform views and CM views together in a way that I haven't seen in Flutter.

Here is a video about this where the JetBrains employees go over a demo of building a cross platform app in 100% Kotlin, just as would be the case with Flutter [0]. Check out the timestamp 41:37 where they talk about the above interoperability. They have an example of a messenger app where the messages are in CM while the text input box is in Swift, so that this ensures that you are not reimplementing the native text editing controls as Flutter does, so I see that as a clear advantage for specific things like that.

Also see timestamp 51:23 where they talk about graceful decomposition where if you decide to remove CM, you are left with a regular Android app as CM is backwards compatible with Jetpack Compose.

I use Flutter quite a bit but it seems like Compose Multiplatform might be the future, since it has a number of clear advantages due to how the architecture of CM is set up.

[0] https://www.youtube.com/live/IGuVIRZzVTk

Re: Dart/Flutter now has macros/metaprogramming

#100

Earlier quoted context omitted.

Or Swift I might add. For me, Flutter is code bloat in comparison with Swift. Swift is doing a great job of reducing the code you need to write, lots of syntactic sugar. I only compared few basic apps like Hello World and Buttons, but the difference in code to write was stunning to me. Flutter also resembles React in this regard to me. Lots of bloat instead of syntactic sugar like for example in Angular.

You might find the following two reddit threads enlightening, as they talk about Flutter's verbosity: https://www.reddit.com/r/FlutterDev/s/kKVzkvpnlj https://www.reddit.com/r/FlutterDev/s/RyBQaLBeuS Tldr, it's a different philosophy between Flutter and Swift, of explicit being more useful that implicit, and of performance optimizations that can be made due to that. The second thread has the tech lead of Flutter resp…

Thanks for the good reads and your TLDR.

I believe there are very good reasons to design Flutter as it is and I don’t want to denigrate it. I think it is awesome work.

It is just that Swift feels extremely elegant and well-shaped, like a Domain Specific Language, and it didn’t feel this in the beginning. It evolved and did a great job.

Maybe like Java and Kotlin. I like Java after all, however I enjoy Kotlin the way I enjoyed Groovy.

BTW: Hixie, tech lead for Flutter, is my man. Dude was instrumental in establishing HTML5.

Post reply on HN