4 ms·
Please not this again. The article you mentioned is incorrect in many places, and was heavily criticized in various communities.[1][2] It doesn't qualify as a v
by yokohummer7 11y ago
Please not this again. The article you mentioned is incorrect in many places, and was heavily criticized in various communities.[1][2] It doesn't qualify as a valid criticism. It is rather a badly written static analyzer promotion.
Also, microbenchmarks are usually not very good at representing the real world characteristics. But then again, please look at the current version of the linked benchmark.[3] Rust now positions itself in the second place, thanks to the recent improvements given to the Rust programs used in the benchmarks. I believe Rust isn't as fast as highly optimized C, but I think it is safe to say that Rust is just as fast as C++, and both Rust and C++ are much faster than GC'ed languages such as Java, Haskell, and Go.
Edit: I would even say that if Rust's performance is comparable to GC'ed languages, there's no point in using Rust in the first place. Rust is paying a lot of complexity to achieve memory safety without relying on garbage collection.
[1] https://news.ycombinator.com/item?id=9531822 https://news.ycombinator.com/item?id=9531822
[2] https://www.reddit.com/r/cpp/comments/35pn6h/criticizing_the_rust_language_and_why_cc_will/cr6o9tz https://www.reddit.com/r/cpp/comments/35pn6h/criticizing_the...
[3] http://benchmarksgame.alioth.debian.org/u64q/which-programs-are-fastest.html http://benchmarksgame.alioth.debian.org/u64q/which-programs-...
- johncolanduoni 11y ago> Edit: I would even say that if Rust's performance is comparable to GC'ed languages, there's no point in using Rust in the first place. Rust is paying a lot of complexity to achieve memory safety without relying on garbage collection. Rust has a lot of nice safety features not related to memory management that I'd love to see even in a language with GC. On top of the obvious lack of data races, linear types and borrowing are great for ensuring other kinds of sanity like preventing you from mutating a collection while you iterate over it.
- Gankro 11y agoTechnically Rust doesn't have proper linear typing, only affine typing. Destructors give you "basically" linear typing, but there's ways to bypass destructors both explicitly and accidentally (though if memory safety isn't at stake, this isn't a worth worrying about IMO): https://doc.rust-lang.org/nomicon/leaking.html https://doc.rust-lang.org/nomicon/leaking.html
- pdpi 11y ago> I would even say that if Rust's performance is comparable to GC'ed languages, there's no point in using Rust in the first place. I'm not sure that's a fair assessment. Even if you didn't gain anything in terms of raw performance, the gains in performance predictability would probably still be enough for many applications. Even if you didn't gain anything in terms of performance at all, the ownership semantics also give you good safety characteristics around concurrency, which would still probably be worthwhile for at least some applications.