Overall, I am +1 on this proposal.
One thing I did notice reading the proposal is that the words 'transfer' and 'transferring' are used 24 times (not including the table of contents) including ten uses of variants of the phrases ‘transfer across concurrent boundaries’ or ‘transfer across concurrency domains’.
That phrase is cited as part of the key question in the Motivation section and the summary of the purpose of the proposal in the Conclusion.
Outside of mentions of Sendable and @sendable, the word ‘send’ or its derivatives only appear five times in the proposal.
- Twice ‘send’ is used as a noun: ‘actor message send’
- Twice it is used paired with ‘receive’ (send/receive, sender/receiver)
- Only once is it used to describe wanting to ‘send bits of computation between concurrency domains’
The proposal text itself favors the term ‘transfer’ to ‘send’ as the best way to describe passing values between concurrency domains.
To me, that indicates that Transferable and @transferable may be better names for the protocol and attribute.
Two comparative drawbacks I can think of to this name are that it is three characters longer and some people will probably want to spell it with two ‘r’s.
A few other points from reading the proposal:
I also noticed that of five mentions of the word ‘send/sender’ in the proposal text, two of them are paired with ‘receive/receiver’. In this proposal, a value that is ‘sendable’ is also implied to be ‘receivable’. A value that is ‘transferrable’ explicitly acknowledges both sides of the transfer.
The examples I’ve found of types that mention one side of an operation tend to be paired with the other side, such as Encodable/Decodable and Foundation’s InputStream/OutputStream. It does seem a little odd that many things will be Sendable but nothing is Receivable.
For me Transferable better describes the entirety of the operation. It marks something I can transfer from one context to another.
And although I realize proposal review should not focus strongly on the follow-on work mentioned in the proposal, I think it’s important to note that the naming decided on in this proposal will set precedent for the naming of future related types.
For instance, I would say that the naming of the UnsafeTransfer property wrapper described in the Future Work / Follow-on Projects section is an excellent, descriptive name.
With the protocol name Transferable, it follows that something transferable is part of a transfer. Something that is not marked as transferable would need to be part of an unsafe transfer. Types and APIs can refer to transfers and transferable values and they fit in the same family of names for related functionality.
The analogous type, I suppose, would be an UnsafeSend where send is used as a noun and not a verb. I’ve typically not heard ‘send’ used as a noun on its own, but in a phrase like ‘message send’. Of course, this property wrapper would not be an UnsafeMessageSend because the message isn’t unsafe, it is the value. So it could be an UnsafeValueSend.
I think most would agree that UnsafeTransfer would be a better name than UnsafeValueSend, but using that name the developer now needs to associate ‘sendable’ with ‘transfer’.
Conclusion
Based on simply the names themselves, I find Transferable to be more descriptive and preferable to Sendable.
For me an even stronger argument for Transferable over Sendable is that it opens things up for much clearer naming of follow-on types and API, with the clear association of a ‘transfer’ with ‘transferable’.