Live data from Hacker News

Dart/Flutter now has macros/metaprogramming

github.com

61–70 of 129 posts

Re: Dart/Flutter now has macros/metaprogramming

#61

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).

To be honest, I'm glad. No development environment can be as great as to justify the horrible, juddery UX I experience as a user in the few apps that I know use it (and probably a few more where I only have a strong suspicion).

Re: Dart/Flutter now has macros/metaprogramming

#62
post #52

Earlier quoted context omitted.

Isn't flutter the anti thesis of that? Making performant JavaScript apps is much much easier than making a performant flutter or especially flutter web app

I have an opposite experience. Making performant JavaScript app require years of learning hacks of web ecosystem. Which is unsurprising, given that web apps build on the foundation layer not suited for performant UI apps. Flutter apps are performant out of the box, because, well, it was designed with this goal in mind.

No idea if it's any better on Android, but on iOS I can recognize a Flutter app within seconds, by the frame rate on a new iPhone dropping to something I haven't seen on any mobile device (iOS or Android!) since the Android 2.2 days on extremely underpowered Qualcomm chips.

Re: Dart/Flutter now has macros/metaprogramming

#63
post #61

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).

To be honest, I'm glad. No development environment can be as great as to justify the horrible, juddery UX I experience as a user in the few apps that I know use it (and probably a few more where I only have a strong suspicion).

The Flutter team say they’ve addressed this with a release that updated the rendering engine.

Re: Dart/Flutter now has macros/metaprogramming

#64
post #63
post #61

Earlier quoted context omitted.

To be honest, I'm glad. No development environment can be as great as to justify the horrible, juddery UX I experience as a user in the few apps that I know use it (and probably a few more where I only have a strong suspicion).

The Flutter team say they’ve addressed this with a release that updated the rendering engine.

Interesting, when?

If that's really the case, I hope to be able to see the effects of that soon in Google Pay on iOS, which is even being touted as a showcase application by Flutter/Google: https://flutter.dev/showcase/google-pay

Re: Dart/Flutter now has macros/metaprogramming

#66

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).

> The ecosystem is immature

There are usually good libraries for most things today. And with Android / Jetpack ecosystem moving so fast and deprecating things, Flutter is something to consider even if you target just Android.

My biggest two concerns were state management and native interop.

State management is probably biggest concern - there are at least 5 approaches / libraries competing for mind-share - and none of them are particularly ergonomic.

I did get an opportunity to work for a while on native interop for android / java [1]. But I haven't been able to work on that since long time.

[1] - https://mahesh-hegde.github.io/posts/building_jnigen/

Re: Dart/Flutter now has macros/metaprogramming

#67
post #42

isn't this bad? every single language I have ever seen that added macros (including Rust) has had problems with macros. unless you are VERY careful, the macro language ends up being turing complete, and/or compile times explode. also now you have two programming languages, and macro heavy code tends to be unreadable, which is fine for the API users, but makes maintenance a nightmare.

> A macro declaration is a user-defined Dart class that implements one or more new built-in macro interfaces. Macros in Dart are written in normal imperative Dart code. There is not a separate "macro language".

Re: Dart/Flutter now has macros/metaprogramming

#68
post #30

Earlier quoted context omitted.

> Java on android You mean Kotlin? Nah. Dart is ok. It doesn't perform as well as those peer languages. It's nice its FFI story is good, but the ecosystem is very weak even compared to Javascript. As for the tooling. It's decent. I wouldn't call it amazing, unless you come from systems that were anemic to begin with, then it seems pretty amazing. As for flutter. I recently installed it again. A test app with a single…

The dart ecosystem is way richer than I expected it to be. So far I've found good options for everything I need and in more than a few cases the libraries are better designed than the JS equivalents. I can't speak to Linux desktop performance but on the Mac my Flutter app sips CPU and memory. Google abandoning it is a real risk. If they continue to support it I think Flutter has a great future.

So I tried the exact same test on a last gen Intel Macbook Pro. Same thing. 20 to 40% app CPU usage not including WindowServer. Putting cursorOpacityAnimates: false "fixes" it, seemingly similar to this:

https://github.com/flutter/flutter/pull/104335

This is more of an eyebrow raising signal to me. This is not quality congruent with a multibillion dollar company backing. If the cupertino widgets are in this sorry of a state they probably should be marked as such.

But perhaps someone more invested in the ecosystem may want to submit that pull request. It seems like low hanging fruit.

Re: Dart/Flutter now has macros/metaprogramming

#69

Earlier quoted context omitted.

Isn't flutter the anti thesis of that? Making performant JavaScript apps is much much easier than making a performant flutter or especially flutter web app

You can use dart without flutter.

Absolutely, but for webapps, is there any other options using dart? For the record, dart is one of my favorite languages. I'm just a bit sad that it is more or less tied to flutter (not by design, just because it's the main usage it gets)

Re: Dart/Flutter now has macros/metaprogramming

#70
post #64
post #63

Earlier quoted context omitted.

The Flutter team say they’ve addressed this with a release that updated the rendering engine.

Interesting, when? If that's really the case, I hope to be able to see the effects of that soon in Google Pay on iOS, which is even being touted as a showcase application by Flutter/Google: https://flutter.dev/showcase/google-pay

https://docs.flutter.dev/perf/impeller
Post reply on HN