Live data from Hacker News

Rust 1.49.0

blog.rust-lang.org

91–100 of 117 posts

Re: Rust 1.49.0

#91
post #51

A question for the Rust crowd, from someone who's thinking about giving Rust another chance in 2021: Last time I tried getting into Rust, some years ago, the recommended way to install it was to use the rustup tool. You were also kind of expected to learn using the "nightly" version of the language, because much of the documentation and stackoverflow answers depended on that. Is this still the case now that we're abo…

rustup is still the recommended way to install. Rust has a 6 week release cadence, and while the language has settled down significantly over the last 1-2 years, there are still a lot of new features arriving that library maintainers are eager to use. Combined with performance improvements, you will almost always want to use a recent compiler. Relatively slow moving package repositories are not a great fit for that r…

> Relatively slow moving package repositories are not a great fit for that reason

Not every distribution is Debian Stable.

Re: Rust 1.49.0

#92
A lot of people are using Rust for advent of code 2020. It's really interesting to see the role that AOC is having with adoption and leveling up Rust knowledge.

Re: Rust 1.49.0

#94

Earlier quoted context omitted.

rustup is still the recommended way to install. Rust has a 6 week release cadence, and while the language has settled down significantly over the last 1-2 years, there are still a lot of new features arriving that library maintainers are eager to use. Combined with performance improvements, you will almost always want to use a recent compiler. Relatively slow moving package repositories are not a great fit for that r…

> Relatively slow moving package repositories are not a great fit for that reason Not every distribution is Debian Stable.

Yes, but some of them are, and some are even worse.

Re: Rust 1.49.0

#95
post #92

A lot of people are using Rust for advent of code 2020. It's really interesting to see the role that AOC is having with adoption and leveling up Rust knowledge.

There was a survey posted on the subreddit[0], which asked about which language people used. I was quite surprised to learn that Rust was the second-most used at 10% (45% used Python).

[0] https://www.reddit.com/r/adventofcode/comments/kj53l1/unoffi...

Re: Rust 1.49.0

#96
post #87

Earlier quoted context omitted.

> The methods on `String` should be a strict superset of the methods on `str` because `String` dereferences to `str` I've found that sometimes this doesn't happen automatically (at least when passing as an argument; maybe not when calling methods). i.e., you have to explicitly call .as_str() in some situations. Even as someone who's comfortable with the String/&str distinction and moderately familiar with Rust, it's…

Maybe read a bit on Deref: https://doc.rust-lang.org/std/ops/trait.Deref.html Any time you have a &String reference, it triggers coercion to &str.

Unfortunately that is not always the case. This fails to compile, for example (and is fairly irritating):

    let my_str = "Hello".to_owned();
    match &my_str {
        "Hello" => (),
        _ => ()
    }

Re: Rust 1.49.0

#98
I really enjoy using Rust for personal side projects. It made me a better C++ developer. I'm excited about stabilized const generics to be able to speed up my linear algebra code.

This issue though prevents me from recommending Rust for closed source development to my colleagues: https://github.com/rust-lang/rust/issues/40552

Re: Rust 1.49.0

#99

Earlier quoted context omitted.

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.

-> specifically this one: "Reborrowing, &*s" Would have been easier to implement with a copy constructor I guess. Why not implicitly clone in some cases (since classes like String gets used so frequently).

> Why not implicitly clone in some cases (since classes like String gets used so frequently)

Because they get used so frequently. Why would we want to add expensive clones to frequently used operations?

This would be like asking why LINQ methods in C# aren't deferred by default. Yes, there's a few situations where that would be nice but it would make the functions largely useless because of how poor performance would be.

Re: Rust 1.49.0

#100
post #32

Nice. Rust is nice language btw. But,when will stable version of Rust be released? By stable,i mean, number of new features added must not be too much. Rust currently seem to be adding too many features every release (which is nice but also not so good at same time)

By that measure, both Java and JavaScript are highly unstable programming languages.

Don't forget C, after all `C2x` is coming...
Post reply on HN