Async traits π€©
Rust
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
Nice! Just in time for my yearly "I should finally learn rust" and then forget about it a week later habit.
Nice! Looks like a more ergonomic, faster Rust.
Sorry to ask, is Rust derived from another language? I know some c++, would that benefit me if I want to learn Rust?
What is powerful about Rust in comparison to other languages?
I find it's a mix between ML languages and C++, and knowing one of them would help yes. If you're tired if chasing a wild pointer because of a subtle use-after-free in a multithreaded monster under gdb, you'll love #rust.
Honestly the only things that are similar to C++ are small amounts of C-like syntax, RAII, smart pointers, and iterators. And even so, Rust improves those features a lot. The list of things that Rust rejects from C++ is much larger; Rust does not have:
new
anddelete
(perhaps discouraged in modern C++)- function overloading
- inheritance (replaced by composition or traits)
- friend classes (replaced by modules)
- exceptions (replaced by
Result
values) - 6 different kinds of first-class constructors (hallelujah)
- templates (replaced by constrained parametric polymorphism)
- variable mutability by default
Rust does OOP very differently and leans harder into functional paradigms.
You could argue that C++'s new is Rust's Box::new, and delete is replaced by RAII. Same concepts but way better ergonomy.