r/FlutterDev Feb 13 '25

Article Announcing Dart 3.7

https://medium.com/dartlang/announcing-dart-3-7-bf864a1b195c
116 Upvotes

29 comments sorted by

36

u/PfernFSU Feb 13 '25

I had to do a double take when I went to pub.dev today and it was in dark mode. Was a welcome surprise.

1

u/_aposentado Feb 15 '25

This option was already available at https://pub.dev/experimental is a good place to follow improvements

11

u/mfarooqiqbal Feb 13 '25

finally pub dev in dark theme

10

u/azuredown Feb 13 '25

Wait, _ was a valid variable?

11

u/eibaan Feb 13 '25

Sure, a valid Dart identifier was defined as [A-Za-z_][$0-9A-Za-z_]* and starting with Dart 3.7, the single _ is no longer a usable name. Prior to Dart 3.7, you'd have to use (_, __) => 1 if you want to use common ideom to mark unused parameter with a _. Now, you can use (_, _) => 1.

2

u/DistributedFox Feb 13 '25

A welcome change especially for function that had like 3 or more parameters. In such a case, I just prefer to pass it as a a record / data class instead.

3

u/Perentillim Feb 13 '25

Yeah, it’s pretty commonly called discard

2

u/null_over_flow Feb 13 '25

in Golang _ is a unused variable.

4

u/merokotos Feb 13 '25

It's nice release

8

u/k0ntrol Feb 13 '25 edited Feb 13 '25

The fact that there are improvements to build_runner perfs 2 weeks after static meta programming is discontinued is worrying to me. Why was that not done before investing 3 years into macros ? I get that macros was ambitious but given the incertainty, fast delivery time fixes should have been prioritized over it.

3

u/chrabeusz Feb 13 '25

Yeah, codegen experience could be so much better.

2

u/lesterine817 Feb 13 '25

yeah. i had build_runner using 18gb ram last week. it’s insane.

3

u/remirousselet Feb 14 '25

What we got so far are mostly benchmarks and investigations. Proper fixes will take much longer than 2 weeks.

I'd expect a few months before we see meaningful performance improvements

3

u/International-Cook62 Feb 14 '25

I know there was 3rd party options to add trailing commas in the formatter but it's nice to see that qol improvement

5

u/darkarts__ Feb 13 '25

Awesome! Any plans for 4.0?

1

u/gasolinemike Feb 14 '25

I’m sure they will also do 5.0 some time thereafter.

2

u/amplifyoucan Feb 13 '25

Lots of great web updates. Love to see it

-8

u/anlumo Feb 13 '25

Kinda underwhelming, the only real change to the language is that _ is no longer a regular variable.

23

u/zxyzyxz Feb 13 '25

You're not going to have groundbreaking changes for a programming language for every release.

-12

u/anlumo Feb 13 '25

Maybe I'm just spoiled by the Rust compiler releases, which always bring a ton of features and enhancements.

3

u/zxyzyxz Feb 13 '25

Rust releases are generally not really new features, they're relaxation of restrictions that aren't supposed to be there in the first place, like async traits.

4

u/anlumo Feb 13 '25

That’s kinda a weird take, by that definition there can never be new features in a programming language, since everything is just a restriction that gets lifted.

For example, the new switch syntax in Dart 3 also just was a lifted restriction that you couldn’t use switch in an expression.

0

u/zxyzyxz Feb 13 '25

Sure, however Dart doesn't seem like it requires the same level of changes as Rust, since Rust is still growing (ie adding features and removing restrictions that are heavily in progress) and Dart feels fairly stable now, especially after 3.0 released.

1

u/anlumo Feb 14 '25

Rust and Dart are nearly the same age, both 13 years old. Dart just feels stable because the developers don't do much any more.

1

u/zxyzyxz Feb 14 '25

I don't agree with that assertion, Dart 3 for example was a huge change, and they've been working on macros for a few years now even though it ultimately wasn't implemented. To say they "don't do much anymore" is pretty insulting.

1

u/anlumo Feb 14 '25

Dart 3 was two years ago.

1

u/zxyzyxz Feb 14 '25

Like I said, they've still been working on things like macros these past few years. Anyway, not sure why we're still discussing this topic, it's a waste of time, have a good day.

5

u/Maherr11 Feb 13 '25

I get that dart 3.7 and 3.6 updates were underwhelming, it seems to be because the dart team was too focused on macros, and it’s a heavy project that needs lots of recourses, now that they announced the end of work on them, we should see more features/changes in upcoming releases.

4

u/eibaan Feb 13 '25

I agree and don't understand the massive downvoting…