DIP 1017--Add Bottom Type--Final Review
aliak
something at something.com
Wed Jan 16 04:16:50 UTC 2019
On Tuesday, 15 January 2019 at 21:39:08 UTC, Meta wrote:
> On Tuesday, 15 January 2019 at 10:08:28 UTC, ixid wrote:
>> Sorry to bikeshed but any name other than 'bottom' would be
>> preferable, D may be the butt of the joke so to speak if code
>> is full of this. There are plenty of synonyms.
>
> "never" is used in Rust, i.e., the never type. Scala and a few
> other languages use Nothing, and Haskell uses Void (not the
> same as `void` in C-family languages).
+1 for not using "bottom". It's really confusing to anyone who is
not a language theory expert. "Never" makes a lot more sense.
Never is also used in Swift. Motivation from their proposal for a
bottom type [0]:
"The best name for the standard library uninhabited type was a
point of contention. Many of the names suggested by type theory
literature or experience in functional programming circles are
wanting:
* Void might have been mathematically appropriate, but alas has
already been heavily confused with "unit" in C-derived circles.
* Names like Nothing, Nil, etc. have the potential to be confused
with the nil value of Optional, or with returning Void.
* Type theory jargon like Bottom wouldn't be immediately
understood by many users.
The first revision of this proposal suggested NoReturn, but in
discussion, the alternative name Never was suggested, which was
strongly preferred by most participants. Never properly implies
the temporal aspect--this function returns never --and also
generalizes well to other potential applications for an
uninhabited type. For instance, if we gained the ability to
support typed throws, then () throws<Never> -> Void would also
clearly communicate a function that never throws."
[0]
https://github.com/apple/swift-evolution/blob/master/proposals/0102-noreturn-bottom-type.md
More information about the Digitalmars-d
mailing list