|
|
|
|
|
by rkangel
3533 days ago
|
|
It's difficult to answer this question with 'one main reason'. Rust is what you get if you build a language that is intended to operate in the same space as C and C++, but benefits from the last 30 years of advances in programming languages. Some things that are better as a result of things that are hard to do right in C++: * Compiler monitors ownership of memory * Compiler monitors ownership across threads * Generics aren't handled as templates, and you can explicitly describe support using things like * trait bounds * Macros are useful but need to operate on something more like the AST rather than text tokens * A richer type system can help you express much more in the types (Rust enums) |
|