[swift-evolution] [Pitch] Typed throws

Zach Waldowski zach at waldowski.me
Mon Feb 27 16:44:32 CST 2017

On Mon, Feb 27, 2017, at 04:05 PM, Daniel Leping via swift-evolution wrote:
> David, IMHO, all you say is absolutely true and typed throws might
> work well, but in theoretic idealistic world. In reality though, you
> end having more exception types than data types, feature cost rises
> exponentially and the code becomes cluttered with all the wrapping.

> I seriously don't understand why would one even think of this feature
> after it's proven a bad practice by Java community. Even Java based
> languages (i.e. Scala) have dropped this "feature".

I share Daniel's concerns 100%. The Swift community is so (rightfully)
concerned about stability right now, and all I can see is how this could
tie the hands of a future API author.

I'd love to have those fears mollified. If Swift can noticeably improve
on the typed throws model (through type checking, conversion, some ABI
guarantees for changing errors, etc.), like Swift has for a lot of
features other languages have tried and had trouble with, we should
definitely move forward with typed throws. If we can't, it does a lot to
hurt what I think is the great success of Swift's error-handling model.


zach at waldowski.me

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170227/d64979da/attachment.html>

More information about the swift-evolution mailing list