4 ms·
Rust's abstractions are only zero cost if you're looking in the wrong place for your costs. The Result / try! stuff in particular I would be very surprised if i
by barrkel 10y ago
Rust's abstractions are only zero cost if you're looking in the wrong place for your costs. The Result / try! stuff in particular I would be very surprised if it is faster than a good exception approach, for example, particularly the happy path. It's amortised throughout though, while different exception throwing mechanisms have dramatically different performance, so people's intuitions aren't reliable.
I like Rust a lot. Zero costs is not a reason though; my reason is no GC and not as bad as C or C++.
- steveklabnik 10y agoDon't forget exceptions aren't free themselves; you need landing pads, etc, all of which are not required.