There's a bunch of syntax churn going on lately; I figured we should get
this out of the way asap after bootstrapping, to minimize further pain
on users.
Having floated a few trial balloons on the mailing list about syntax
over the winter, and seen that on almost every issue we have a broad
level of "everyone disagrees about everything", I've decided to approach
syntax in a more meritocratic sense of weighting opinions by level of
code contribution, and ultimately since my name is all over the thing,
to reserve a veto on any change I really wouldn't to defend in front of
an audience. So we're going to move faster and a bit more unilaterally
on syntax than I'd earlier implied.
Sorry, but it just doesn't look like "consensus" is something that
emerges very often in syntax conversations.
If some part of what we're doing *really* grinds your gears after a few
weeks or months of staring at it, file a followup bug and we can
possibly revisit, and formally (re-)poll major developers to see what
they think. But right now the stuff being done is roughly agreeable
among the full timers working on rust, and is as follows:
- path.to.module changed to path::to::module.
- Module, type and value namespaces have been made disjoint.
- vec(1,2,3) changed to [1,2,3] as a value constructor.
Further ones queued up:
- vec[T] will turn into T[] in the type grammar.
- foo[T] will change to foo.<T> for type parameter specification.
- rec(a=b, c=d) will change to {a: b, c: d} as a value constructor.
- rec(int a, int b) will change to {a: int, b: int} as a type
constructor.
- tup(a,b) will change to (a,b) in both type and value grammars;
one-element tups will become inexpressible (unless someone really
cares, then I guess we can copy the python hack of (a,). Tups
will require parentheses.
- foo:constraint() will change to foo|constraint() in the type
grammar.
- alt and case arms will probably lose a bit of indentation and
parentheses. They're over-chatty right now.
- 'auto' will probably turn to 'let' and 'let' to something else
('var' or such)
Hopefully this will settle down in another few weeks. A lot of this
stuff was decided months and months ago and we've just been waiting for
rustboot to die (I removed it from the repository a few days ago).
-Graydon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev