Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>You get memory safety. That's about it for Security

Not true, you get one of the strongest and most expressive type systems out there.

One example are the mutability guarantees which are stronger than in any other language. In C++ with const you say "I'm not going to modify this". In Rust with &mut you're saying "Nobody else is going to modify this." This is 100x more powerful, because you can guarantee nobody messes with the values you borrow. That's one very common issue in efficient C++ code that is unfixable.

Sum types (enum with value) enable designing with types in a way otherwise only doable in other ML-based languages. Derive macros make it easy to use as well since you can skip the boilerplate.

Integers of different sizes need explicit casting, another common source of bugs.

Macros are evaluated as part of the AST. A lot safer than text substitution.

Further the borrow checker helps with enabling compile time checking of concurrency.

The list goes on, but nobody that has tried Rust properly can say that it only helps prevent memory safety issues. If that's your view, you just showed that you didn't even try.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: