Re:Rust for C++ programmers – part 2: control flow
by pcwalton on Sunday April 20, 2014 @05:52PM
(#7618618)
The issue is that "expression" is the same nonterminal in C, whereas "expression" and "pattern" are separate nonterminals.
[ Parent
| on HN ]
Re:Rust for C++ programmers – part 2: control flow
by acqq on Monday April 21, 2014 @03:35AM
(#7620178)
In C a difference still exists between a lvalue and a rvalue. Even if you can unify something at one level, you have to generate completely different code. C++ is even harder. So I can imagine something can be done when there would be an intention, probably something would have to be a bit more unified. But I guess nobody even tried.
BTW, I really like the basic goals of Rust, namely making something directly linkable with C but having as much as possible safety and more modern features. And I appreciate the work of the developers of Rust. Even introductory materials would benefit by promoting what we can do that wasn't as safe to be done in C.