Skip to main content

New site for Dart news and articles

For the latest Dart news, visit our new blog at  https://medium.com/dartlang .

Rolling back setter syntax, more updates from Dart language design meeting

Posted by Bob Nystrom

Here's my notes from this Monday's Dart language design meeting.


New getter and setter syntax

We heard lots of feedback from users that they don't like the new setter syntax. Instead, we'll keep the current syntax, so no more "=" after the setter name. Instead, just:

    set blah(value) => ...

We will go ahead with the getter changes (removing ()).

Ryan Dahl's thread on misc

Go's syntax for loops and stuff versus Dart's is really just a matter of taste. Dart tries harder to be similar to other languages to make it easier for users to get comfortable and to make porting code easier.

We talked a bit about optional semicolons. There is some vague worry that we could end up with some of the problems that JavaScript has. For now, we don't have any plans to make them optional. But, since doing so wouldn't be a breaking change, we can always decide to do that later.

Lots of people don't like "&" for export. Message received: we'll do something different. Not sure what yet.

Parameter lists

We have a design for a modification to parameter lists that lets you define optional positional parameters that are not also named. Sometime soon, I'll see if I can get a document out that explains it.

We won't know how well this works until we port code to use it. We aren't sure how many of the current APIs are using optional parameters positionally or by name. So we'll try it out and see if we need to iterate on it again.

Cascades

Are implemented everywhere now (VM, dart2js, editor). Users can start playing with them!

Non-const statics

These are coming soon. This means you'll be able to initialize top-level final variables, and static final fields using non-const initializers. They will be lazily evaluated the first time the variable is accessed.

As always, thank you all very much for the constructive, detailed feedback. As you can see, it directly affects the course of the language. Dart wouldn't be what it is without you. We encourage you to join the conversation on the Dart mailing list and ask Dart questions on Stack Overflow.