2 ms·
My big hope in this regard is Rust, which has a very good track record if implementing good, usable, zero-cost abstractions. If they manage to implement zero-c
by vog 10y ago
My big hope in this regard is Rust, which has a very good track record if implementing good, usable, zero-cost abstractions.
If they manage to implement zero-cost futures [1][2], maybe they will also implement sime kind of zero-cost error handling abstraction (either via exceptions, or via some other useful abstraction for that purpose).
[1] https://aturon.github.io/blog/2016/08/11/futures/ https://aturon.github.io/blog/2016/08/11/futures/
[2] https://news.ycombinator.com/item?id=12268988 https://news.ycombinator.com/item?id=12268988
- barrkel 10y agoRust'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.