Notes from May 6th language meeting

419 views
Skip to first unread message

Bob Nystrom

unread,
May 16, 2013, 4:34:45 PM5/16/13
to General Dart Discussion
Note that these are my notes from last week's meeting. I was on vacation most of last week so didn't get a chance to send them out. As Andrei noted, there was no meeting this week. I feel like I should use "note" a few note more note times in this paragraph.

API maturity annotations

Lars says Dan Grove wants a decision on annotations that denote maturity of source code. For most stuff, Lars thinks we should just annotate the whole library. The place where makes sense is dart:html. In that case, we can make an exception.

I asked if this is a language question, or just a question for people at the level of the language team.

Lars says Dan specifically said for the language.

Everyone agreed this is a good idea for the Dart system. [Gilad later clarified that they all also agree it is not a language issue.]

Lars says everything except dart:html we'll put in the libraries.dart config file. We can show that in the Editor.

[Dan later clarified was that his question was the meta-question to decide if this issue is a language issue or not.]

? operator

Gilad: Can we get rid of it?
Lars: Yes.
Gilad: OK, done.

map literals

Lars asks if everyone likes the new proposal [that Gilad sent to the language team]. Everyone does.

[This is now in the latest published spec. Basically, you can have non-string keys in map literals. Woo!]

exports

Lars says Florian has some issues about exports. Asked if Gilad is talking to him about it.

[This is the same issue about exports that came up on the mailing list recently.]

library names

Gilad says Kasper's proposal looks fine. Given other decisions we've made, it makes things more consistent.

Lars is reluctantly accepting it.

This means it will be a static warning to import multiple libraries with the same name. This is a breaking change so we should let people know it's coming.

Cheers!

- bob

Ladislav Thon

unread,
May 17, 2013, 1:17:50 AM5/17/13
to mi...@dartlang.org
? operator

Gilad: Can we get rid of it?
Lars: Yes.
Gilad: OK, done.

Awesomesauce!
 
map literals

Lars asks if everyone likes the new proposal [that Gilad sent to the language team]. Everyone does.

[This is now in the latest published spec. Basically, you can have non-string keys in map literals. Woo!]

Actually, you can have arbitrary expressions as keys! Love that.
 
library names

Gilad says Kasper's proposal looks fine. Given other decisions we've made, it makes things more consistent.

Lars is reluctantly accepting it.

This means it will be a static warning to import multiple libraries with the same name. This is a breaking change so we should let people know it's coming.

It makes sense to me, but I still wonder about the purpose of library names. They are not very important, as they can be duplicate, but they are so important that duplicitate imports are becoming a warning.

I think I'd just tie library names to package names. At least as a convention.

LT
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Iván Zaera Avellón

unread,
May 17, 2013, 4:50:44 AM5/17/13
to misc
>map literals
>Lars asks if everyone likes the new proposal [that Gilad sent to the language team]. Everyone does.
>[This is now in the latest published spec. Basically, you can have non-string keys in map literals. Woo!]

Woo! +++  (I don't know why this restriction was in place, but always sounded silly to me; well, to be honest, it more sounded like: "I'm a lazy guy and don't want to support this in the compiler" >:-P ).

Thanks.



2013/5/16 Bob Nystrom <rnys...@google.com>

--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new
 
 

Florian Loitsch

unread,
May 17, 2013, 5:15:48 AM5/17/13
to General Dart Discussion
On Fri, May 17, 2013 at 10:50 AM, Iván Zaera Avellón <iza...@gmail.com> wrote:
>map literals
>Lars asks if everyone likes the new proposal [that Gilad sent to the language team]. Everyone does.
>[This is now in the latest published spec. Basically, you can have non-string keys in map literals. Woo!]

Woo! +++  (I don't know why this restriction was in place, but always sounded silly to me; well, to be honest, it more sounded like: "I'm a lazy guy and don't want to support this in the compiler" >:-P ).
The main reason was, that `{ foo: 42 }` looks like a map from "foo" to 42 for JavaScript programmers. In Dart you need to find the variable "foo".



--
Give a man a fire and he's warm for the whole day,
but set fire to him and he's warm for the rest of his life. - Terry Pratchett

Iván Zaera Avellón

unread,
May 17, 2013, 5:18:25 AM5/17/13
to misc
Ah. I see.

But this is Dart, not JS. For the same reason, I come from Java and "{ foo: 42 }" means "syntax error" to me >;-).


2013/5/17 Florian Loitsch <floi...@google.com>

Ladislav Thon

unread,
May 17, 2013, 5:27:32 AM5/17/13
to mi...@dartlang.org
>map literals
>Lars asks if everyone likes the new proposal [that Gilad sent to the language team]. Everyone does.
>[This is now in the latest published spec. Basically, you can have non-string keys in map literals. Woo!]

Woo! +++  (I don't know why this restriction was in place, but always sounded silly to me; well, to be honest, it more sounded like: "I'm a lazy guy and don't want to support this in the compiler" >:-P ).
The main reason was, that `{ foo: 42 }` looks like a map from "foo" to 42 for JavaScript programmers. In Dart you need to find the variable "foo".

Once upon a time, { foo: 42 } was a legal Dart syntax that meant the same as { "foo": 42 }. It was dropped a long time ago, but still :-)

Well, I think that the current state is much better.

LT
Message has been deleted
Message has been deleted
Message has been deleted

Greg Lusk

unread,
May 17, 2013, 8:40:49 AM5/17/13
to mi...@dartlang.org
So will the elimination of the ? operator mean that ternary if statements are no longer supported?

Iván Zaera Avellón

unread,
May 17, 2013, 8:41:50 AM5/17/13
to misc
I suppose they are talking about the elvis operator, not the ternary operator...


2013/5/17 Greg Lusk <integ...@gmail.com>

Matthew Butler

unread,
May 17, 2013, 9:29:00 AM5/17/13
to mi...@dartlang.org


On Friday, May 17, 2013 9:40:49 AM UTC-3, Greg Lusk wrote:
So will the elimination of the ? operator mean that ternary if statements are no longer supported?
 

I suppose they are talking about the elvis operator, not the ternary operator...
 

Neither in fact. They are talking about the ? prefix operator to test if an optional argument was actually passed to a method/function or not.

Zdeslav Vojkovic

unread,
May 17, 2013, 10:12:28 AM5/17/13
to mi...@dartlang.org
I was just thinking yesterday why would you want to know whether the argument was omitted or was explicitly set to default value :)


--

Bob Nystrom

unread,
May 17, 2013, 12:05:03 PM5/17/13
to General Dart Discussion
On Thu, May 16, 2013 at 10:17 PM, Ladislav Thon <lad...@gmail.com> wrote:
It makes sense to me, but I still wonder about the purpose of library names. They are not very important, as they can be duplicate, but they are so important that duplicitate imports are becoming a warning.

I don't get it either, but some of the language designers are super gung-ho about them. <shrug>
 

I think I'd just tie library names to package names. At least as a convention.

This is exactly what Kasper's proposal suggests. :)

- bob

Bob Nystrom

unread,
May 17, 2013, 12:08:46 PM5/17/13
to General Dart Discussion

On Fri, May 17, 2013 at 1:42 AM, mezoni <andrew...@gmail.com> wrote:
If I cannot analize metadata (that defined in language specifiction) at runtime.

I know it's taken a while, but this is coming and is being worked on right now. The Dart team is broken in several smaller groups: the language designers, the VM, dart2js, the Editor, and a few others. Features that span multiple groups tend to take a lot longer to design and implement. The Dart team is spread across several offices (across multiple timezones) so it's much slower when we need to coordinate.

In the case of runtime access to annotations, we need annotations to be speced in the language, we need Gilad and the others who work on the mirrors API to design the API to access them, we need the VM team to implement it, we need the dart2js team to implement it, and we need the Editor folks to support it in the Editor. Designing it also requires coordination across the teams. Since runtime access to annotations can have a dramatic impact on tree-shaking and other dart2js optimizations, the design has to be coordinated with them.

We'll get there, but it takes a while.

Cheers,

- bob

Bob Nystrom

unread,
May 17, 2013, 12:10:56 PM5/17/13
to General Dart Discussion

On Fri, May 17, 2013 at 2:50 AM, mezoni <andrew...@gmail.com> wrote:
I understand. Dart want add namespaces to libraries.

Import prefixes mostly cover this. They have the advantage of being controlled by the code doing the import and not the code defining the name. That's good because it's the consumer who knows which other names he's using and which may collide.
 

import 'package:from_bob/foo.dart'; // called 'from_bob.foo'
import 'package:from_ladislav/foo.dart'; // called 'from_ladislav.foo'

 
You could do:

import 'package:from_bob/foo.dart' as from_bob;

And then access stuff like:

from_bob.someThingInFoo();

Like this?
library unittest.unittest_html_config;

Or may be?
library unittest.html_config;

Yes, these are both valid now.

Cheers!

- bob

Bob Nystrom

unread,
May 17, 2013, 12:12:27 PM5/17/13
to General Dart Discussion

On Fri, May 17, 2013 at 2:59 AM, mezoni <andrew...@gmail.com> wrote:
This will be possible?
import 'library:unittest.html_config';

Better syntax for package imports has been on my wishlist for a long time. I really hope the language designers take action on it at some point. Star this bug if you are interested.

Thanks!

- bob
Message has been deleted

Bob Nystrom

unread,
May 17, 2013, 7:29:24 PM5/17/13
to General Dart Discussion

On Fri, May 17, 2013 at 11:12 AM, mezoni <andrew...@gmail.com> wrote:
Bob you not understand me. Prefix does not remove library name collision.

>> This means it will be a static warning to import multiple libraries with the same name.

Not class name collisions but multiple libraries with the same name.

Ah, yes, sorry I misinterpreted you. My understanding is that the language designers plan to make it a warning to import two libraries with the same name. Short of editing those libraries yourself, there will be nothing you can do to avoid that warning.

To mitigate that, the plan as I understand it is to establish a convention of using the package name as part of the library name. Since package names are unique on pub.dartlang.org, that should help to avoid collisions.

Cheers,

- bob

Message has been deleted
Message has been deleted

Andrei Mouravski

unread,
May 20, 2013, 4:50:27 AM5/20/13
to General Dart Discussion

As this is a discussion of the Dart language itself, the e...@dartlang.org is a more appropriate place for these discussions.
Misc should be used for discussions that do not fit anywhere else.

You should note that this note has been noted so that the noted note note is noted.

Andrei.

Bob Nystrom

unread,
May 20, 2013, 12:43:48 PM5/20/13
to General Dart Discussion

On Fri, May 17, 2013 at 9:09 PM, mezoni <andrew...@gmail.com> wrote:
That's exactly what you forgot to write in the beginning of the this message.
By the way where the Kasper's proposal?

It was in a rough document sent to the language team, but not shared widely. I think the relevant bits of it have been added to the language spec now, in particular:

It is a static warning to import two di erent libraries with the same name. 
 
A widely disseminated library should be given a name that will not conflict with other such libraries. The preferred mechanism for this is using pub, the Dart package manager, which provides a global namespace for libraries, and conventions that leverage that namespace.

(Note that the second paragraph is non-normative.) 

- bob

Reply all
Reply to author
Forward
0 new messages