Live data from Hacker News

Rust 1.48

blog.rust-lang.org

1–10 of 119 posts

Re: Rust 1.48

#2
One of the things that made me so excited about Rust when I first used it was the capabilities of the Rustdoc system. The built in examples that are also unit tests, the ease of just using markdown... and now the linking is even simpler. It’s one of my favorite things about the language, and I think is why so many crates have such good documentation, because it’s easy to do. (and it’s tested and validated so you know it’s right!)

Re: Rust 1.48

#3
Congratulations! The highlight for me is stable conversion from Vec to array:

  let my_arr: [u32; 3] = my_vec.try_into().expect("msg");

Re: Rust 1.48

#4
post #3

Congratulations! The highlight for me is stable conversion from Vec to array: let my_arr: [u32; 3] = my_vec.try_into().expect("msg");

Indeed, I can't wait for const generics to become available outside of std, I've been bumping into that limitation since pre-rust-1.0 days, it'll be amazing to finally be able to rewrite all that hacky code correctly.

Re: Rust 1.48

#5

One of the things that made me so excited about Rust when I first used it was the capabilities of the Rustdoc system. The built in examples that are also unit tests, the ease of just using markdown... and now the linking is even simpler. It’s one of my favorite things about the language, and I think is why so many crates have such good documentation, because it’s easy to do. (and it’s tested and validated so you know…

Not directly related, but when I was learning programming back in highschool (before the Internet) what made it easy was the built in help in Turbo Pascal. You could press F1 over any function or keyword and you were given a detailed description and example of usage. Learning C later using the K&R book and Google was a huge downgrade. Even today I think that language help built into the IDE should be a basic functionality.

Re: Rust 1.48

#7
post #4
post #3

Congratulations! The highlight for me is stable conversion from Vec to array: let my_arr: [u32; 3] = my_vec.try_into().expect("msg");

Indeed, I can't wait for const generics to become available outside of std, I've been bumping into that limitation since pre-rust-1.0 days, it'll be amazing to finally be able to rewrite all that hacky code correctly.

min_const_generics is targeted for Rust 1.50 :)

Re: Rust 1.48

#8
post #4

Earlier quoted context omitted.

Indeed, I can't wait for const generics to become available outside of std, I've been bumping into that limitation since pre-rust-1.0 days, it'll be amazing to finally be able to rewrite all that hacky code correctly.

min_const_generics is targeted for Rust 1.50 :)

For anyone who wants to learn more: https://github.com/rust-lang/rust/pull/79135

Re: Rust 1.48

#9
post #3

Congratulations! The highlight for me is stable conversion from Vec to array: let my_arr: [u32; 3] = my_vec.try_into().expect("msg");

Hmm. Could you do this kind of code for a static allocation at compile-time too?

Re: Rust 1.48

#10
post #9
post #3

Congratulations! The highlight for me is stable conversion from Vec to array: let my_arr: [u32; 3] = my_vec.try_into().expect("msg");

Hmm. Could you do this kind of code for a static allocation at compile-time too?

I don’t think so - you can only use static functions to declare static variables. But you could do it with a macro. It’s debatable whether that would be readable and predictable, though.
Post reply on HN