News for hackers. Stuff that matters.
Re:Rust for C++ programmers – part 2: control flow by acqq on Sunday April 20, 2014 @08:26AM (#7616588)
I've tried to find any meaningful example of "why not." Is "let" supposed to be needed because of something like this?

   let (a, b) = get_tuple_of_two_ints();
I don't see that it's fundamentally different to parse if it would be written like this:

   (a, b) := get_tuple_of_two_ints();
It's true that the parser has to wait for := to do know the semantics of the expression on the left side of it, but it can definitely be done.
Re:Rust for C++ programmers – part 2: control flow by pcwalton on Sunday April 20, 2014 @04:38PM (#7618397)
It would require making "expression" and "pattern" into the same nonterminal in the grammar, and then deciding afterwards whether something that was parsed was an expression or a pattern. This is sometimes called a "cover grammar" because it "covers" two distinct nonterminals. It is possible--ECMAScript 6 does it--but it's definitely a complex way to parse. It doesn't seem compatible with Rust's design goal of being easy to parse and regular, e.g. for tooling.
Re:Rust for C++ programmers – part 2: control flow by bjz_ on Sunday April 20, 2014 @09:08AM (#7616668)
Rust can pattern match on structs, fixed length vectors, references, and it has keywords to bind them as mutable and/or by-ref. Doing all that without a `let` would extremely challenging.