[swift-evolution] [swift-evolution-announce] [Review] SE-0102: Remove @noreturn attribute and introduce an empty NoReturn type

Frederick Kellison-Linn fred.kl at me.com
Tue Jun 21 17:24:21 CDT 2016


 * What is your evaluation of the proposal?
-1. I don't believe that the '-> NoReturn' adequately expresses the behavior of a function.  I view the construction 'T -> U' as a contract which states 'give me a T and I'll give you a U'. This stops making sense when U is NoReturn: 'give me a T and I'll give you a NoReturn (note: I won't actually give you a NoReturn)'! This construction also moves the behavioral information about the function to the end of the signature, where it is more easily missed.

 * Is the problem being addressed significant enough to warrant a change to Swift?
I don't believe so. The main argument against @noreturn seems to be about complexity in the compiler, and an empty/bottom NoReturn type introduces complexity of its own with regards to subtyping, and special-casing the compiler to handle functions which return a particular type.

 * Does this proposal fit well with the feel and direction of Swift?
Again, not IMO. Semantic modifications to function behavior in Swift are already well encompassed by attributes. These are a well established part of the language; if @noreturn were one of few attributes that were not wanted in the language, that would be a different matter, but attributes aren't going anywhere. Furthermore, I think that swift has mostly shied away from overly clever solutions in favor of clarity. I realize the desire in increasing the power of Swift's type system, but extending it to include properties which are arguably outside of the type system altogether doesn't seem like the right direction to go in.

 * If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
-

 * How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
I read through the proposal and then the initial discussion on swift-evolution. Overall, I think that the @noreturn attribute better expresses that the behavior of the function is exceptional. NoReturn feels a bit too much like a clever hack to represent a type-that-is-not-a-type.

Freddy

On Jun 21, 2016, at 10:04 AM, Chris Lattner <clattner at apple.com> wrote:

Hello Swift community,

The review of "SE-0102: Remove @noreturn attribute and introduce an empty NoReturn type" begins now and runs through June 27. The proposal is available here:

 https://github.com/apple/swift-evolution/blob/master/proposals/0102-noreturn-bottom-type.md

Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at

       https://lists.swift.org/mailman/listinfo/swift-evolution

or, if you would like to keep your feedback private, directly to the review manager.

What goes into a review?

The goal of the review process is to improve the proposal under review through constructive criticism and contribute to the direction of Swift. When writing your review, here are some questions you might want to answer in your review:

   * What is your evaluation of the proposal?
   * Is the problem being addressed significant enough to warrant a change to Swift?
     * Does this proposal fit well with the feel and direction of Swift?
     * If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
 * How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

More information about the Swift evolution process is available at

       https://github.com/apple/swift-evolution/blob/master/process.md

Thank you,

-Chris Lattner
Review Manager

_______________________________________________
swift-evolution-announce mailing list
swift-evolution-announce at swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution-announce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160621/e0b36a8f/attachment.html>


More information about the swift-evolution mailing list