It's not necessarily significantly more difficult than the existing bridging we have, but would still require significant changes. Data
's backing store is an enum
which can represent multiple different forms of storage which explicitly references NSData
and NSMutableData
, for instance. Bringing this down into the stdlib
requires a refactor of how this works, potentially at a relative loss of performance compared to what we have now. Not insurmountable, but still requiring a decent amount of change.
This also has the potential to be a source-breaking change as anyone who currently references Foundation.Data
to disambiguate between the type and another Data
type would break, unless we typealias Foundation.Data = Swift.Data
, or similar.
One of the big questions here is: how much would we gain by going through this risky process that we don't already have? What would we get by lowering this over what you get with import Foundation
at the moment?