Earlier quoted context omitted.
The "2018 edition" of Rust made breaking changes to the syntax (but the core stayed compatible, so 2015 edition and 2018 edition Rust can be used simultaneously on the same project). They then said that they'd probably do the same thing in 2021. Now they're debating whether a 2021 edition is needed since there aren't any breaking changes with broad support except for the removal of deprecated syntax and APIs. This is…
I don’t think there’s consensus around very large things, but there are some regrets that are commonly expressed about smaller stuff. For example, lots of people think the PartialEq/Eq split was a mistake. I like to half-joke that String should have been StrBuf. Macros have several flaws and are under-developed, etc. There are also some thoughts about Rust-like languages with some differences, see https://boats.gitla…
Five Years of Rust
41–50 of 133 posts
Re: Five Years of Rust
#42Re: Five Years of Rust
#43Is the current status of Rust that it is slower than Go ? According to this previous post - https://news.ycombinator.com/item?id=23058147
As someone who is not a particularly good programmer who has done quite a bit of coding in both at this point, it seems to be easier to accidentally write extremely slow code in rust than it is in go, but once you start optimizing, rust will generally be faster, sometimes by quite a lot. I’ve also run into fewer pathological cases as I’ve learned more of the idiomatic rust patterns.
Re: Five Years of Rust
#44Now that there's been 5 years since v1.0, is there any consensus on design mistakes that Rust made? Any mistakes that people wish they could turn back time and do differently but can't because it would break compatibility with too much existing code out there? That's the more interesting list to me.
Incompatibility between C enums and Rust enums forces to use integers instead, which leads to errors. (Rust doesn't allow to enum variables to be forward compatible, i.e. it cannot have a value outside of enum).
A Rust enum is an actual enumeration type, which C does not have. This is far more powerful.
Re: Five Years of Rust
#45What’s the best resource to get started with Rust and make a desktop app?
Personally I used iced [1] a bit and found it very pleasant to use. iced is cross platform, sponsored and very active.
Re: Five Years of Rust
#46Earlier quoted context omitted.
I’ve been using the anyhow crate and it’s made error handling almost painless.
Just to point out for other readers, nowadays to make a custom error type you just need : - an enum (or struct) - its Display implementation - its Error implementation, now just one function And a few `impl From for MyError` to make the try? operator work. For a library it's really not that much work. And even that can be simplified further to a few derive macros with another library : thiserror.
(Sidenote, I don't use `impl Error` because I never use `Box`. Which isn't to say that's correct, just to say that I've never had the need to implement it)
Re: Five Years of Rust
#47Rust mods have to stop listening to the elite language intelligentsia. Successful eco systems are pragmatic and idiomatically straightforward. Everything & the kitchen sink in a language is not a recipe for success. Every language that has a long lifespan spent a long time in feature minimal stasis too. The world won't learn a moving target.
So many of these features Rust adds just fill in holes in an already extensive ecosystem.
I agree some feature development could be toned down to mitigate the moving target problem.. hell I think last years poll expressed roughly that. But, I think there's still a ton of features yet to come that merely complete what we already have.
Re: Five Years of Rust
#48Rust mods have to stop listening to the elite language intelligentsia. Successful eco systems are pragmatic and idiomatically straightforward. Everything & the kitchen sink in a language is not a recipe for success. Every language that has a long lifespan spent a long time in feature minimal stasis too. The world won't learn a moving target.
Re: Five Years of Rust
#49Rust mods have to stop listening to the elite language intelligentsia. Successful eco systems are pragmatic and idiomatically straightforward. Everything & the kitchen sink in a language is not a recipe for success. Every language that has a long lifespan spent a long time in feature minimal stasis too. The world won't learn a moving target.
Building C++ (or C) projects is such a clusterfuck that it's given rise to header-only libraries.
In Rust, everything is "cargo build", and adding a dependency is one line. This has only failed for me when there's a dependency on a C system library that I can't satisfy.
Is it bad to have too many dependencies? Sure, maybe. Is that an excuse to have artificial friction? No. I eagerly await the day when meson or conan or whatever becomes The C++ Dependency And Package Manager.
My other favorite part of Rust is the elitist language features like iterators, immutable borrows, functional programming, etc.
Re: Five Years of Rust
#50Is the current status of Rust that it is slower than Go ? According to this previous post - https://news.ycombinator.com/item?id=23058147
As someone who is not a particularly good programmer who has done quite a bit of coding in both at this point, it seems to be easier to accidentally write extremely slow code in rust than it is in go, but once you start optimizing, rust will generally be faster, sometimes by quite a lot. I’ve also run into fewer pathological cases as I’ve learned more of the idiomatic rust patterns.