Pitch: Add identifier uniqueness criteria to SSWG minimum requirements
As per its charter, the SSWG tries to create a "create a robust, healthy ecosystem for server application development with Swift". Wikipedia has the following to say about an ecosystem:
An ecosystem is a community of living organisms in conjunction with the nonliving components of their environment, interacting as a system.
My interpretation in a software context of this would include that many different components need to be able to interact as a system. In other words, it should be possible to combine pretty much any (SwiftPM) package into an application which is 'a system'.
However, Swift and SwiftPM both have certain restrictions regarding names which can stop two packages being able to coexist in one application. Namely, at least the following must be unique across a whole application:
- all module names
- the package basename (
swift-nio
inhttps://github.com/apple/swift-nio.git
) - the pacakge name (the
name: String
inPackage.swift
, alsoswift-nio
for SwiftNIO)
Currently, the only requirement on uniqueness that the SSWG requires is
- Name (must be unique within SSWG)
Besides this being not precise enough, I strongly believe the SSWG should add the following to the minimum requirements:
A package must ensure that at the time it submits the proposal to the SSWG the following uniqueness criteria a met:
- all module names are unique
- the package basename is unique
- the package
name: String
inPackage.swift
matches the package basename and is uniqueThe author(s) should make a reasonable effort to ensure that the names are unique, for example by searching github.com & gitlab.com. Archived or very outdated and clearly inactive packages can be ignored but must be listed as having possibly conflicting identifiers.
Also, for the health of the ecosystem, authors should try to prevent future name clashes to a reasonable degree. For example, even if still available, a package should abstain from naming a module or a type justConnection
because of the likelihood of clashes in the future.
Notes: I previously started a discussion thread for the wider issues. This pitch is not as wide-ranging as the discussion thread and tries to merely address the immediate, worst issues that we would face if we ignored module/identifier clashes.
Please let me know your thoughts on this. If people are generally happy, I'd proceed with a slightly more detailed proposal.