Hacker News new | past | comments | ask | show | jobs | submit login

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/

[2] https://news.ycombinator.com/item?id=12268988




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++.


Don't forget exceptions aren't free themselves; you need landing pads, etc, all of which are not required.




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

Search: