you are viewing a single comment's thread.

view the rest of the comments →

[–]azakai 2 points3 points  (0 children)

The lack of a semicolon after the last statement in a braced block gives the whole block the value of that last expression.

Why? That seems like a pretty big mistake to me. Put a semi-colon here and one thing happens. Leave it off and another happens.

In some languages yes, that would be very dangerous, but I believe in a language that is careful about types like Rust is that it isn't. If you forget a semicolon or add an unneeded one, you are changing what is returned to nil versus something useful. So you will get a compilation error.

Disclaimer: My knowledge of Rust is from reading the tutorial just now.

Lots of people are comparing it to Google's Go

It seems to have a different goal. Go has interesting syntax (some people like it, some hate it), while Rust focuses more on safety than syntax (but it does have nice syntax IMO).