3 ms·
> To some extent, all languages do this: there is almost always a tradeoff between performance and slower, safer implementations. Well, probably except Rust, f
by beltsazar 3y ago
> To some extent, all languages do this: there is almost always a tradeoff between performance and slower, safer implementations.
Well, probably except Rust, from which you get both performance and safety. Sometimes it's with a cost of ergonomics, though. Some people, including the Rust's creator himself, would trade performance for better ergonomics in the case of asynchronous programming. They prefer having a non-zero-cost green threads to the current state of async prog in Rust.
- jakobnissen 3y agoNot always all of the performance. Rust encourages array access with superfluous bounds checks, unnecessary UTF8 validation, and uses tagged sum types over the more memory efficient raw union types.
- cmovq 3y agoRust does tradeoff performance for safety. Example: integer division [1]. [1]: https://godbolt.org/z/71sxnfff5 https://godbolt.org/z/71sxnfff5