7 ms·
I agree. No matter gray beards bashing Rust on HN every time it comes up, programming in Rust brings me joy and I will never use C++ again if I have a choice.
by selfmodruntime 4y ago
I agree. No matter gray beards bashing Rust on HN every time it comes up, programming in Rust brings me joy and I will never use C++ again if I have a choice.
- gigel82 4y agoInteresting; could this be because you've been using outdated C++ ? (legacy codebases started before C++98 tend to be particularly painful) FWIW, I prefer the power of C++ over Rust's hand-holding; but can also see its appeal for someone that's not as confident over the minutia.
- hedora 4y agoNot the person you asked, but for me (coming from C++20, with lambdas, async, etc), the big win is that the borrow checker automates away boring PR comments about "you used std::unique_ptr in a non-idiomatic way that is technically safe, and it bleeds memory unsafety into some random API, so write this level N+1 magic instead". It also checks that all my threaded code is data race free. On the downside, it's support for safe (in the sense that the compiler checks it) lock free programming is basically non-existent, which means that stuff that would be easy in C++ ends up being in Rust unsafe blocks that you need a PhD in type theory to reason about.
- gavinray 4y ago> On the downside, it's support for safe (in the sense that the compiler checks it) lock free programming is basically non-existent, which means that stuff that would be easy in C++ ends up being in Rust unsafe blocks that you need a PhD in type theory to reason about. I'm not familiar with the C++ built-in facilities for lock-free stuff (but learning about them currently) Could you expand on this if you're willing, maybe with some pseudocode? I've also been curious about things like cache alignment, aligned memory, and false-sharing size detection in Rust -- all of which C++ has as std built-ins
- zozbot234 4y agoRust has atomic types that rely on interior mutability. No unsafe blocks are needed for those.
- returningfory2 4y ago> ... but can also see its appeal for someone that's not as confident over the minutia. I think this is mischaracterization of why people choose Rust (and FWIW it comes across as condescending). People choose Rust over C++ partially for the same reason people write unit tests. We accept that no matter how good we are at writing software, we are still fallible, and so we introduce structures around our work to minimize the fallout from that fallibility.
- ZephyrBlu 4y ago> but can also see its appeal for someone that's not as confident over the minutia It's not confidence, I just don't care. I don't want to learn the minutia of C++. Rust is the thing that has got me interested in lower level programming.
- selfmodruntime 4y agoNo, it‘s exactly the opposite: I enjoyed C++ 11 but trying any feature tacked on beyond that just makes me want to smack my head onto my desk. The standard isn‘t slowing down: for c++ 23 the committee has announced even more features when compilers haven‘t yet implemented every CPP 17 feature. What good is a standard if no one is following it?
- zabzonk 4y agoi will admit to the beard, but isn't it strange that the number of posts praising rust and haskell has dropped of a cliff here in the past months?
- kibwen 4y agoThere are just as many written-in-Rust posts as ever, although the practice of appending "in Rust" to the title has fallen off (there's literally one of these at #3 on the front page right now). Meanwhile, an article from IEEE evangelizing Haskell was literally on the front page this morning with 256 votes.