Live data from Hacker News

Rust 1.49.0

blog.rust-lang.org

11–20 of 117 posts

Re: Rust 1.49.0

#11
post #7

I am surprised the blog post doesn't mention the stabilization of binding both by-move and by-ref in patterns [1]. I have personally been waiting on this one for several years. Time to go remove my workarounds. Thanks! [1]: https://github.com/rust-lang/rust/pull/76119

There is always an art to what to decide to put in vs not, and it wasn't 100% clear to us how important folks consider this feature. We waffled a bit, it was basically a coinflip on putting it in or not.

I generally started going from the blog posts to the changelog as I felt for a few times now that the stuff I care about was not in the announcement blog post.

Re: Rust 1.49.0

#12
I wish they would streamline the string handling capabilities. Currently the conversions between String and &str are really ugly to look at. In general the conversion between types don't seem all that great with developers having to either use crates or write their own code. They need to take more inspiration from C# which continues to be the benchmark of elegance (obviously personal opinion). That said, rust is still better than C++ - namely its package management is great. I just wish the compiler doesn't keep second guessing me :D

Re: Rust 1.49.0

#13
Congratulations to everyone.

For me it was specially nice to have some minutes shaved off from full builds.

Re: Rust 1.49.0

#14

I wish they would streamline the string handling capabilities. Currently the conversions between String and &str are really ugly to look at. In general the conversion between types don't seem all that great with developers having to either use crates or write their own code. They need to take more inspiration from C# which continues to be the benchmark of elegance (obviously personal opinion). That said, rust is stil…

I'm not sure what you mean by conversion between String and &str? To get an owned String from a &str you just use the `into` method, no?

Re: Rust 1.49.0

#15

I wish they would streamline the string handling capabilities. Currently the conversions between String and &str are really ugly to look at. In general the conversion between types don't seem all that great with developers having to either use crates or write their own code. They need to take more inspiration from C# which continues to be the benchmark of elegance (obviously personal opinion). That said, rust is stil…

> the conversions between String and &str are really ugly to look at.

This is entirely up to you; unless you find method calls ugly, in which case, you've got bigger problems :)

> They need to take more inspiration from C#

Could you elaborate a bit? I'm not familiar with what C# does here.

Re: Rust 1.49.0

#16

Earlier quoted context omitted.

There is always an art to what to decide to put in vs not, and it wasn't 100% clear to us how important folks consider this feature. We waffled a bit, it was basically a coinflip on putting it in or not.

I generally started going from the blog posts to the changelog as I felt for a few times now that the stuff I care about was not in the announcement blog post.

Yeah, it's just impossible to please everyone, especially in releases like these, which have a few minor things and that's it. Rust 1.51 will be easy, given that "const generics" is a huge headline feature almost every Rust user will care about, but for features that are full of tiny things, it's just way way less clear.

This has the funny effect of posts getting harder to write as time goes on; we have less releases with big, important features, and more releases with "tons of bugfixes and some minor improvements."

Re: Rust 1.49.0

#17
Rust, where even unstable functions can be stable!

(Yes, I know that "unstable" in slice::select_nth_unstable refers to unstable sorting.)

Re: Rust 1.49.0

#18
post #14

I wish they would streamline the string handling capabilities. Currently the conversions between String and &str are really ugly to look at. In general the conversion between types don't seem all that great with developers having to either use crates or write their own code. They need to take more inspiration from C# which continues to be the benchmark of elegance (obviously personal opinion). That said, rust is stil…

I'm not sure what you mean by conversion between String and &str? To get an owned String from a &str you just use the `into` method, no?

Strings implement a lot of different conversions, since they're very general. You've got:

* Into, with s.into()

* An inherent method, .as_str()

* Deref coercion, &s

* Reborrowing, &*s (this builds on Deref too but isn't a coercion and can be done in places where coercion doesn't kick in)

... and probably some others I'm forgetting.

Re: Rust 1.49.0

#19
I recently wrote a utility for myself in Rust after having done several in C#. I like both languages, but Rust introduces pain points for no apparent reason. For example, I hate this way of dealing with errors

    match result {
        Ok(value) => value,
        Err(result) => { 
            panic!("error traversing directories {}", result);
        }
    };
It's awkward and ugly. I'm back to C#, now on .NET 5.) and find that it just got noticeably faster! It was already fast.

"Astonishing Performance of .NET 5: More Data"

https://medium.com/swlh/astonishing-performance-of-net-5-mor...

Re: Rust 1.49.0

#20

I wish they would streamline the string handling capabilities. Currently the conversions between String and &str are really ugly to look at. In general the conversion between types don't seem all that great with developers having to either use crates or write their own code. They need to take more inspiration from C# which continues to be the benchmark of elegance (obviously personal opinion). That said, rust is stil…

> the conversions between String and &str are really ugly to look at. This is entirely up to you; unless you find method calls ugly, in which case, you've got bigger problems :) > They need to take more inspiration from C# Could you elaborate a bit? I'm not familiar with what C# does here.

In C# there is a helper class: https://docs.microsoft.com/en-us/dotnet/api/system.convert?v...

I'm still figuring my way around rust so obviously some noob questions follow: -> what's with the move/copy mess ? I know why they are needed but it seem to be in the face with all the explicit '&' all over the place in any reasonably sized code. Why not hide it a bit by letting the implicit copy to happen to simpler structures ? (at compile time).

-> Why no love for inheritance? :) - it makes certain patterns easier to implement

-> Why no love for global/static variables ? I know they are prone to be misused but some patterns like singleton really need a lot of shortcuts to implement. And there will always be some cases where you want to keep variables with static and global scope

Post reply on HN