Honest question from a non C++ developer: what's the main point of Rust? What's the primary reason for choosing it over any other language? When would it be most appropriate to choose?
I wrote a Donald Trump text to speech server in Rust. It's blazingly fast. If I'd written it in Python, it'd have taken seconds to generate audio. If I'd written it in C++, it'd likely have memleaked or segfaulted since I'm not skilled or patient enough to write safe C++. Rust is pretty much the coolest thing ever in my opinion. It's easy and fun to write. Cargo is the best package manager ever, and makes importing l…
Announcing Rust 1.12.1
11–20 of 30 posts
Re: Announcing Rust 1.12.1
#12Honest question from a non C++ developer: what's the main point of Rust? What's the primary reason for choosing it over any other language? When would it be most appropriate to choose?
1. The main benefit of Rust is its nearly cost-free safety guarantees. It's much harder to write code that is prone to UB with Rust than with C++. The comparison is almost silly, in fact, from that perspective. It comes with a runtime cost (e.g. drop flag checks, bounds/other memory access checks) in some cases, but for all cases other than those requiring even that last bit of performance this cost is tiny in comparison with the work the rest of the program is doing and well worth it in my opinion.
2. The primary reason for choosing it over any other language is context dependent. This leads me to my last point.
3. It would be fine to use for anything, really, but I think in the sense of "most appropriate" that you mean, it's "most appropriate" for systems programming that needs to be as fast as C++, but not necessarily melt-the-metal fast. Primarily this is because: a) it's as fast as C++ in almost all cases (and probably faster than equivalently-safe C++ in at least some cases) and b) it's much less likely I'll write code that smashes stacks, has data races, blows up memory or does a bunch of other crap that's trivial in C++ (or other languages). Even in cases where melt-the-metal fast is necessary it seems possible to do in Rust, but it just takes a lot of effort. That's deliberate on the part of the Rust developers, and it's difficult to argue against the reasoning behind it.
Where Rust might really shine is helping a new generation of programmers write performant code that is safe without having to learn by trial-by-fire.
Re: Announcing Rust 1.12.1
#13Honest question from a non C++ developer: what's the main point of Rust? What's the primary reason for choosing it over any other language? When would it be most appropriate to choose?
Rust is a replacement for C++. It is meant to be a modern, general-purpose systems language, where "systems" generally means anywhere you need to be close to the metal. This includes areas like embedded systems and high performance computing. Modern means it has features and tooling you expect from languages in 2016. For example, on a language level, Rust has type inference, sum types, pattern matching, proper generi…
For the sake of hypothetical example, presume I have had a long history of involvement in some C++ libs which I associate with good times, hilarious IRC sessions, friends, and pouring love into the labor of creating them during 0300 caffeine overdoses. How could I possibly evaluate leaving this behind without such bias?
Many choices are vulnerable to silly human biases which are hard to detect. Debating C++ versus Rust seems to be tough for some, and technical arguments have a propensity for becoming circular, so here's an analogy instead.
- Imagine, (if you have no extreme attachments to the web) that we have created a new web with new protocols, software, hardware, solved most crypto issues, authentication is reliable, we created the safe and anonymous place of everyone's (some ppls) dreams. Most of the advances are wonderful and (mostly) fueled by the latest research and smart minds, but there are a few bugs. Overall, an improvement and well adopted but still needing polish. The problem? All the old content isn't there. Some amazing new experiences await, but reddit and youpn are not unless you pull up an old web browser. If you were tasked with creating new content, which web would you choose and why?
I propose devs consider following either this, or some other method to evaluate C++ vs. Rust more objectively and try to set attachments aside. If, rather than thinking "but I won't have libX", you ask "how can I implement this functionality better today", you may decide that casting off old clutter is liberating and insightful.
I hope this helps some of you.
Re: Announcing Rust 1.12.1
#14Re: Announcing Rust 1.12.1
#15This is a point release that they don't need to do - on the grounds that it's not a bad time to do one, but it should help in the future to do point releases quickly if there is a real need to (security, etc).
There's a commitment in the rust team to making life really really good for developers, and I appreciate that a lot.
Re: Announcing Rust 1.12.1
#16Is Rust "mature" enough to start to dabble with and actually put down some hours into (and thus replace C in my plan)? Only hobby projects so far.
Re: Announcing Rust 1.12.1
#17Question for you guys: I'm planning to putting down some time into learning java for the higher stuff along with C the coming year. I know the very basics of C and java, but after looking into the documentation for rust I got that feeling of "oh man, this really looks fun to get into." Is Rust "mature" enough to start to dabble with and actually put down some hours into (and thus replace C in my plan)? Only hobby pro…
For lower level stuff Rust is a better option. Better productivity, equal performance, much higher safety.
Unless you have specific needs that require Java/C of course.
Re: Announcing Rust 1.12.1
#18Honest question from a non C++ developer: what's the main point of Rust? What's the primary reason for choosing it over any other language? When would it be most appropriate to choose?
Rust is a replacement for C++. It is meant to be a modern, general-purpose systems language, where "systems" generally means anywhere you need to be close to the metal. This includes areas like embedded systems and high performance computing. Modern means it has features and tooling you expect from languages in 2016. For example, on a language level, Rust has type inference, sum types, pattern matching, proper generi…
Re: Announcing Rust 1.12.1
#19Question for you guys: I'm planning to putting down some time into learning java for the higher stuff along with C the coming year. I know the very basics of C and java, but after looking into the documentation for rust I got that feeling of "oh man, this really looks fun to get into." Is Rust "mature" enough to start to dabble with and actually put down some hours into (and thus replace C in my plan)? Only hobby pro…
For higher level stuff Erlang/Elixir is a much better option. Productivity will be way higher. For lower level stuff Rust is a better option. Better productivity, equal performance, much higher safety. Unless you have specific needs that require Java/C of course.
Re: Announcing Rust 1.12.1
#20Earlier quoted context omitted.
Rust is a replacement for C++. It is meant to be a modern, general-purpose systems language, where "systems" generally means anywhere you need to be close to the metal. This includes areas like embedded systems and high performance computing. Modern means it has features and tooling you expect from languages in 2016. For example, on a language level, Rust has type inference, sum types, pattern matching, proper generi…
If you think Rust is ready for high performance computing, I suspect you don't do HPC for a living and you haven't tried to do it with Rust. It's not just missing the needed libraries.