Live data from Hacker News

Five Years of Rust

blog.rust-lang.org

131–133 of 133 posts

Re: Five Years of Rust

#131

Earlier quoted context omitted.

You’re welcome. (I imagine that you’d get the same version conflict situation with your idea btw: std::2018::Option is not the same type as std::2021::Option.)

Even if std::2018 is just doing: `pub use std::2021::Option`?

Ehh you're right, actually.

I still think you run into other issues, though.

Re: Five Years of Rust

#132
post #79

The progress on the error messages truly is worth highlighting, and kudos to the team for all the hard work there. It's one of the hardest things to get right in a programming language, particularly if that language has a fussy compiler.

It is great. Rust 1.0 with the old borrow checker required knowing where to strategically place extra curly brackets, and when to add `ref` or `.as_ref()` incantations. Now with the smarter borrow checker and ergonomic improvements most of it is unnecessary, and the error messages know how to suggest the rest.

Still quite a lot of circular gotchas, so it's not a panacea for studying the docs!

Re: Five Years of Rust

#133
post #126
post #125

Earlier quoted context omitted.

While I would prefer brackets, that would not be enought to solve all the problems since, there would be conflict with array syntax too.

But the square brackets used in array access nest, so the parsing is never ambiguous. The reason > needs braces is that without them, if you're parsing and so far you've seen these characters: let y: RectangularArray You don't know if that final > is ending the argument list, or is a greater-than operator, with the rest of an expression coming after it. But if it was square brackets, then a closing square bracket on…

In case anyone ever stumbles across this thread, a couple of posts about this:

https://keleshev.com/parsing-ambiguity-type-argument-v-less-...

https://soc.me/languages/stop-using-for-generics

Post reply on HN