[swift-evolution] [Review] SE-0055 Make unsafe pointer nullability explicit using Optional

Антон Жилин antonyzhilin at gmail.com
Sat Mar 26 11:15:13 CDT 2016


UnsafePointer is most often used for interfacing with C libraries. They
will almost never add nullability annotations. It means that
UnsafePointer<Type>? will become an idiom. But we currently have a terser
form, and it's arguably clear from it that Pointer can be null.

90% of programmers and 99.9% of those working with C libraries are familiar
with concept of C pointer and null pointer. So it's clear for every one we
can call a programmer that *Pointer types contain plain C nullable pointers
with Swift whistles.

Overall, separating strongly connected concepts and then tying them
together using compiler magic just can't have a reasonable explanation.
~0x0 in UnsafeBufferPointer is utterly rediculous.

> What is your evaluation of the proposal?
-1

> Is the problem being addressed significant enough to warrant a change to
Swift?
No, I don't see any motivation for the change.

> Does this proposal fit well with the feel and direction of Swift?
No, it's headed in the opposite direction.

> If you have you used other languages or libraries with a similar feature,
how do you feel that this proposal compares to those?
Rust denotes pointers using * and has no problems with that.

> How much effort did you put into your review? A glance, a quick reading,
or an in-depth study?
Followed the discussion.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160326/4370b144/attachment.html>


More information about the swift-evolution mailing list