News for hackers. Stuff that matters.
Re:The power of Result types in Swift by KirinDave on Monday June 18, 2018 @02:34PM (#17340530)
Actually, I'm not entirely right here. Joe Groff caught up with me on twitter and explained to me that because Swift requires you to check exceptions, it actually generates static logic at the call site. This means handlers have a cost on both sides of the "railway", but it means that exception handling has a fairly optimal codepath.

It'll still be cheaper to do a simple pattern match into a struct for complex handlers, but for depth 1 they should essentially be identical. That's a very interesting tradeoff for the Swift compiler!

There are no comments on this comment yet.