Live data from Hacker News

Dart/Flutter now has macros/metaprogramming

github.com

71–80 of 129 posts

Re: Dart/Flutter now has macros/metaprogramming

#71

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…

Dart also deserves alternative UI frameworks. With varying combinations of native controls usage and imperative-ness.

Re: Dart/Flutter now has macros/metaprogramming

#72

to anyone that has not used it, dart is an excellent language * instant compilation * amazing tooling * null safety * typed I could go on.

Please do, because excluding minor exceptions, the more popular of recent programming languages have these as table stakes. Everything (even previously dynamic languages like python) has some form of static typing, options/null-safety, and really good tooling (ts ecosystem is huge, rust compiler has entire articles praising it for making people better programmers). Some languages might be slow to compile but have solutions like HMR for ts and are actively being improved in languages like rust.

Re: Dart/Flutter now has macros/metaprogramming

#73

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 o…

> 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've heard this critique a lot (particularly about Flutter), but I'm not sure I agree that having multiple state-management approaches is a bad thing. Can you elaborate on why this is painful?

From my perspective, (and to borrow the 'ergonomic' metaphor), it's like opening a toolbox and finding 5 different screwdrivers with similar heads. Some might not be well-suited to your project, and of those that do, one might have a handle that you find more ergonomic. I find it hard to imagine a screwdriver that could fit all screws and feel amazing in all hands at once.

Also, fwiw, I find Riverpod to be very ergonomic ;)

Re: Dart/Flutter now has macros/metaprogramming

#74
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 building a medium sized app in Flutter right now. Occasionally I notice animation lag in development, but in production it is really smooth.

Re: Dart/Flutter now has macros/metaprogramming

#75
post #59
post #44

Flutter is like Qt where they implement their own windows themselves. But instead of C++ and OpenGL, they use ... Dart and CSS? All the ease-of-use and ergonomics of C++, and the raw bare metal performance of Python. /s I try to give it the benefit of the doubt, so I found a demo site. Here is the first example I opened: https://flutter.github.io/samples/web/material_3_demo/ I click play on the progress indicator. My…

I started some cross-platform work about 6 ago and came into Flutter with plenty of hesitation. I was fearing this much ranted about janky feeling, but so far it has not come. AFAICT from the forums and such, the Web target is definitely far, far behind the mobile targets. This isn’t really a concern for me. For the app I’m building for iOS and Android, the result has been performant, and I’ve really liked the langua…

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

Re: Dart/Flutter now has macros/metaprogramming

#76
post #62
post #52

Earlier quoted context omitted.

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.

Yep, my typical experience with flutter apps is having way more frame drops, and occasional bugs which lock up the entire UI and require an app restart. Thankfully I think google is moving towards just using the platform UI for most apps, though I can't remember where I read that so take it with a grain of salt.

Re: Dart/Flutter now has macros/metaprogramming

#77
post #62
post #52

Earlier quoted context omitted.

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.

Most likely they’re not using the new impeller rendering engine. My flutter app is very smooth on iOS and I didn’t have to put in any fancy hacks to make it that way.

Re: Dart/Flutter now has macros/metaprogramming

#78
post #68

Earlier quoted context omitted.

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…

Sounds like this is specific to the Cupertino widgets? I’m not using those because I think they’re just going to put you in the uncanny valley of almost native Mac UI.

The material stuff looks good and performs well and at this point users have more desktop apps on their machine that don’t use native controls than do.

My flutter app is way more responsive and efficient than the electron prototype it replaced.

Re: Dart/Flutter now has macros/metaprogramming

#79
post #44

Flutter is like Qt where they implement their own windows themselves. But instead of C++ and OpenGL, they use ... Dart and CSS? All the ease-of-use and ergonomics of C++, and the raw bare metal performance of Python. /s I try to give it the benefit of the doubt, so I found a demo site. Here is the first example I opened: https://flutter.github.io/samples/web/material_3_demo/ I click play on the progress indicator. My…

Flutter web is much less mature and performant than the native build targets. If the web is your primary target it’s not a good choice, at least not today.

Flutter mobile/desktop on the other hand performs great and is way more efficient than web UI.

Re: Dart/Flutter now has macros/metaprogramming

#80
post #75
post #59

Earlier quoted context omitted.

I started some cross-platform work about 6 ago and came into Flutter with plenty of hesitation. I was fearing this much ranted about janky feeling, but so far it has not come. AFAICT from the forums and such, the Web target is definitely far, far behind the mobile targets. This isn’t really a concern for me. For the app I’m building for iOS and Android, the result has been performant, and I’ve really liked the langua…

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).
Post reply on HN