I don't get it. What are the benefits of using Rust instead of C++?

I don't get it. What are the benefits of using Rust instead of C++?

Attached: 1522080297769.jpg (720x736, 32K)

Memory safety, zero-cost abstractions, use threads without fearing data races, and more.

Having modules.

Yes. This correct. Very good language to learn and definitely better than C.

That's a great feature to have

Because it's superior to C in a lot of ways. The compiler looks out for you and prevents you from using dangling pointers, memory that has already been deleted and fearless concurrency.

A lot of the things the people above mentioned. But, tools for Rust (like IDEs) are limited. Mostly, you'll use a text editor with a plugin or extension.

Not him, but:
>memory safety
lots of tools for that in modern C++
>use threads without fearing data races
there are thread synchronization tools in C++

how are those benefits? What am I missing?

It does it without being the clusterfuck that is C++

Different user here. Let's just assume that being stuck with C++ forever is a foregone conclusion. Therefore it doesn't matter how good or bad any other language is. C++ is the only language we can use.
However, the C++ we use tomorrow won't be the same C++ we use today, which in turn isn't the C++ of 20 years ago (literally 20 years ago in 2018). What will the C++ of the future look like? Think of Rust as a proof of concept for a version of C++ that isn't the horrible anal vore we have today. Instead of replacing it, it's a proof of concept for how to fix it.

If you use it in a sensible way, it's manageable. I would take that any day over finding a Rust alternative of Qt

That sounds quite reasonable. To use it as a test bed for new ideas and features. However that doesn't really answer the question.

Does any Rust shill here have some nice list with comparisons of pleb C/C++ vs masterrace Rust approaches to common problems?

You mean like what footguns are in C/C++ but not in Rust? For starters, try compiling this little gem and run any sanitizers on it you please. In Rust, this wouldn't compile.
#include

struct Test {
~Test() {
std::cout

This proves Rust's superiority

>Memory safety,
What does this even mean

Not accessing memory that doesn't belong to me.

You're right, it sounds like "typed language" when some retard means a statically type-checked language.

Yes, that's what I meant.
This example is quite insane, not exactly a solution to a common problem, but it's getting close to what I would like to see.

Does statically typed and strongly typed mean the same thing?

How does rust handle memory allocation failures?

No. Neither does statically typed and statically type-checked.

The only benefit is self wanking with your lads at mozilla instead of doing useful work.

In standard library when "unwrap" something, a lot of times it just "panics" (runtime error). Or, you can use a match statement to get either the data inside the wrap or the error if there is one

Wtf why is this the way it is? Only the initial scope an auto object is on should be where the destructor is called right?

just dont use auto

All types have either move semantics xor copy semantics. Move is the default. Copy types can't have destructors. The RHS of a move assignment is invalidated automatically and this is checked at compile time.
Order of evaluation is defined for all expressions. The compiler can see where mutation happens and prevent/allow reordering for cases where it doesn't matter.
All numeric operations have defined behavior. There are no implicit conversions between numeric types. Number literals are polymorphic.
Compiled binaries export a C ABI and can pretend to be C without the need for a special linker.
Concepts/typeclasses ("traits") are built into the language. Method resolution is trait-based instead of inheritance-based, and the caller can always specify how exactly a method name should be resolved.
All concurrency APIs take trait-constrained inputs. This allows the compiler to enforce synchronization at compile time for any types that need it (like mutable data structures).