Very limited scope for access control/(sub)modules in Swift 4


(Douglas Gregor) #1

Hi all,

Like everyone else in the Swiftverse, the core team recently spent some time discussing access control in Swift. While we love to see the enthusiasm on this topic, wholesale changes to the access control model—such as the introduction of submodules or a complete shift to a more type-centric access control model—are out of scope for Swift 4.

The core team does feel that a small part of this discussion—the reversal of SE-0025’s separation of “private” and “fileprivate”---is in scope for Swift 4, for which there is a proposal draft here:

  https://github.com/apple/swift-evolution/pull/627

  - Doug


(Jon Hull) #2

One quick question:

Nevin had a proposal that would remove ‘fileprivate' and redefine ‘private' to mean “private to the submodule” (which defaulted to file scope unless otherwise defined). This would be functionally equivalent to reversing 0025 (until submodules were added in a later version of swift). Would such a proposal be in scope for Swift 4, as it is really just defining semantics for future updates?

Thanks,
Jon

···

On Mar 6, 2017, at 9:31 AM, Douglas Gregor via swift-evolution <swift-evolution@swift.org> wrote:

Hi all,

Like everyone else in the Swiftverse, the core team recently spent some time discussing access control in Swift. While we love to see the enthusiasm on this topic, wholesale changes to the access control model—such as the introduction of submodules or a complete shift to a more type-centric access control model—are out of scope for Swift 4.

The core team does feel that a small part of this discussion—the reversal of SE-0025’s separation of “private” and “fileprivate”---is in scope for Swift 4, for which there is a proposal draft here:

  https://github.com/apple/swift-evolution/pull/627

  - Doug

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(Zachary Waldowski) #3

I'm sort of glad to see this; was worrying that access control was
getting buried in the shuffle.

Is there anything that the community can do to help address submodules
as more of a tooling problem than a language one in the Swift 4
timeframe? Is there any low-hanging fruit to work on or proposals to
review for SwiftPM, for instance? Radars we can dupe for DevTools? That
kind of thing?

All the best —
Zachary Waldowski
zach@waldowski.me

···

On Mon, Mar 6, 2017, at 12:31 PM, Douglas Gregor via swift-evolution wrote:

Hi all,

Like everyone else in the Swiftverse, the core team recently spent some
time discussing access control in Swift. While we love to see the
enthusiasm on this topic, wholesale changes to the access control
model—such as the introduction of submodules or a complete shift to a
more type-centric access control model—are out of scope for Swift 4.

The core team does feel that a small part of this discussion—the reversal
of SE-0025’s separation of “private” and “fileprivate”---is in scope for
Swift 4, for which there is a proposal draft here:

  https://github.com/apple/swift-evolution/pull/627

  - Doug

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(Douglas Gregor) #4

One quick question:

Nevin had a proposal that would remove ‘fileprivate' and redefine ‘private' to mean “private to the submodule” (which defaulted to file scope unless otherwise defined). This would be functionally equivalent to reversing 0025 (until submodules were added in a later version of swift). Would such a proposal be in scope for Swift 4, as it is really just defining semantics for future updates?

I think that what you’re describing is equivalent to what is proposed by

  https://github.com/apple/swift-evolution/pull/627

  - Doug

···

On Mar 6, 2017, at 11:01 AM, Jonathan Hull <jhull@gbis.com> wrote:

Thanks,
Jon

On Mar 6, 2017, at 9:31 AM, Douglas Gregor via swift-evolution <swift-evolution@swift.org> wrote:

Hi all,

Like everyone else in the Swiftverse, the core team recently spent some time discussing access control in Swift. While we love to see the enthusiasm on this topic, wholesale changes to the access control model—such as the introduction of submodules or a complete shift to a more type-centric access control model—are out of scope for Swift 4.

The core team does feel that a small part of this discussion—the reversal of SE-0025’s separation of “private” and “fileprivate”---is in scope for Swift 4, for which there is a proposal draft here:

  https://github.com/apple/swift-evolution/pull/627

  - Doug

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(John McCall) #5

One quick question:

Nevin had a proposal that would remove ‘fileprivate' and redefine ‘private' to mean “private to the submodule” (which defaulted to file scope unless otherwise defined). This would be functionally equivalent to reversing 0025 (until submodules were added in a later version of swift). Would such a proposal be in scope for Swift 4, as it is really just defining semantics for future updates?

That seems like a reasonable way of thinking about things, but ultimately, distinctions without a difference are non-normative. If/when we introduce some concept of sub-modules, we'll have to consider what "private" and "internal" mean for them them. It's no good to pretend that it was settled in some discussion held at a time when it had zero language impact.

John.

···

On Mar 6, 2017, at 2:01 PM, Jonathan Hull via swift-evolution <swift-evolution@swift.org> wrote:

Thanks,
Jon

On Mar 6, 2017, at 9:31 AM, Douglas Gregor via swift-evolution <swift-evolution@swift.org> wrote:

Hi all,

Like everyone else in the Swiftverse, the core team recently spent some time discussing access control in Swift. While we love to see the enthusiasm on this topic, wholesale changes to the access control model—such as the introduction of submodules or a complete shift to a more type-centric access control model—are out of scope for Swift 4.

The core team does feel that a small part of this discussion—the reversal of SE-0025’s separation of “private” and “fileprivate”---is in scope for Swift 4, for which there is a proposal draft here:

  https://github.com/apple/swift-evolution/pull/627

  - Doug

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution