Live data from Hacker News

Dart/Flutter now has macros/metaprogramming

github.com

81–90 of 129 posts

Re: Dart/Flutter now has macros/metaprogramming

#81

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.

Re: Dart/Flutter now has macros/metaprogramming

#82
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.

Have you seen Zig's comptime macros? On the surface, that seems like a great approach: no second language and readability fails

Re: Dart/Flutter now has macros/metaprogramming

#83
post #62

Earlier quoted context omitted.

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.

Flutter apps have god awful performance when there is even a single platform view on the screen. In effect this means that if the app is monetized by ads, have any video, map embed or anything of the sort, it will have sub-30fps and very janky scroll even on iPhone 15 Pro and it really seems that there is no hacks to save you.

Re: Dart/Flutter now has macros/metaprogramming

#84

Earlier quoted context omitted.

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)

How do you feel about Java? How about Ruby? (If you have worked with those). I'm mainly asking so I have a baseline for what your preferences are. Considered Dart in the past but haven't tried yet

Re: Dart/Flutter now has macros/metaprogramming

#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 close to zero support from third parties and therefore you end up having a lot of these platform views. Even things like Google Ads have no native Flutter support and therefore adding a single ad on a list ruins the app. Reading Flutter issues about the performance related issues is sad as the same issues have been there since the beginning and there is no end in sight.

However, if your app can do without any platform views, the performance seems pretty good.

Re: Dart/Flutter now has macros/metaprogramming

#86

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…

ClojureScript has a pretty good story there but of course not statically typed. There are some good libraries if you want more checking.

Re: Dart/Flutter now has macros/metaprogramming

#87
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.

On Android, Flutter apps are typically even faster than native on cheap low-end devices from my experience. I'm comparing using a Galaxy J3 pro and the difference is visible in favor of Flutter. On high-end devices, I don't see any difference.

That's also one of the reason why the framework is so popular in developing countries.

Re: Dart/Flutter now has macros/metaprogramming

#88

Earlier quoted context omitted.

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)

Jaspr is one such framework, it is written similarly to Flutter but it instead outputs HTML, CSS and JS.

Re: Dart/Flutter now has macros/metaprogramming

#89

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?

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

Actually Android is all about Java, Kotlin and C++, with a bit of Rust on the side.

All languages that have more use cases than being bound to a GUI framework, which is the problem with Dart.

Re: Dart/Flutter now has macros/metaprogramming

#90

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

Well, Flutter is primarily for apps that work cross platform, if you use Kotlin then you can only run it on Android (yes, Kotlin Multiplatform with Compose Multiplatform exist but they're even less mature than Flutter).

For JS/TS, you could use React Native but you also wouldn't get the full spread of platforms as RN is primarily for mobile and the web and desktop implementations are based on third-party support, plus the developer experience is inferior to Flutter.

So, if you want to make multiplatform apps, use Flutter, but if you only need to make Android or RN apps, use those respective platform tools.

Post reply on HN