4 ms·
C++ is the most important source inspiring Rust throughout its development. Rust devs just like to downplay that role. - Rust has interface inheritance with pr
by alchemio 3y ago
C++ is the most important source inspiring Rust throughout its development. Rust devs just like to downplay that role.
- Rust has interface inheritance with pretty much the same syntax
- Rust’s generics are monomorphized, exactly like C++ templates. They also have the same syntax. The only difference is that Rust generics are trait bound.
- Rust RAII is used exactly as it’s used in C++. Moves in Rust are destructive, while in C++ they are not. At the time where move semantics were proposed for C++ in the C++03 era, both types were proposed and the committee decided to go with non-destructive moves.
- Scope resolution syntax is also a carryover from C++.
When the words superset and subset are used in regards to C, C++ and Objective-C, it is quite a misunderstanding to describe C as a subset of Rust.
- pornel 3y agoRust is inspired by C++ the same way JavaScript was inspired by Scheme. Yeah, there are some borrowed concepts, but it's a different language.