# SE-0264 (review #2) — Standard Library Preview Package

**URL:** <https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288>\
**Category:** Proposal Reviews\
**Created:** [December 2, 2019, 6:52pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288 "2019-12-02T18:52:45Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkremenek](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tkremenek/32/9115_2.png) [@tkremenek](https://forums.swift.org/u/tkremenek)\
**Post date:** [December 2, 2019, 6:52pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/1 "2019-12-02T18:52:45Z")

</div>

The **second** review of [SE-0264 — Standard Library Preview Package](https://github.com/apple/swift-evolution/blob/master/proposals/0264-stdlib-preview-package.md) begins now and runs through December 10, 2019

This is a follow up to the [previous review discussion](https://forums.swift.org/t/se-0264-standard-library-preview-package/29068) after the proposal was [returned for revision](https://forums.swift.org/t/returned-for-revision-se-0264-standard-library-preview-package/29865).

The proposal is written by @ben-cohen, @moiseev, and @nnnnnnnn.

Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to keep your feedback private, directly to the review manager (via [email](mailto:kremenek@apple.com) or direct message in the Swift forums).

## What goes into a review of a proposal?

The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift.

When reviewing a proposal, here are some questions to consider:

- What is your evaluation of the proposal?
- Is the problem being addressed significant enough to warrant a change to Swift?
- Does this proposal fit well with the feel and direction of Swift?
- If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
- How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

Thanks,  
Ted Kremenek  
Review Manager

---

<div class="post-metadata">

**Author:** ![Nevin](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nevin/32/617_2.png) [@Nevin](https://forums.swift.org/u/Nevin)\
**Post date:** [December 2, 2019, 7:09pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/2 "2019-12-02T19:09:43Z")

</div>

Here’s the [diff of the proposal](https://github.com/apple/swift-evolution/commit/c1718396e4ab7cb751d550771b41911f3db25f9a?short_path=c5d6320#diff-c5d632026dd4a4a023eaaae375eb30cd) between October 18 and today.

---

<div class="post-metadata">

**Author:** ![DevAndArtist](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/devandartist/32/287_2.png) [@DevAndArtist](https://forums.swift.org/u/DevAndArtist)\
**Post date:** [December 2, 2019, 7:25pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/3 "2019-12-02T19:25:04Z")

</div>

It isn't stated as a goal of the proposal but would it be possible to _officially_, retroactively introduce several preview packages of past proposals?

This would allow to back port naturally things like:

- `Result`
- diffing API's
- `Identifiable`
- etc.

---

<div class="post-metadata">

**Author:** ![anandabits](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/anandabits/32/355_2.png) [@anandabits](https://forums.swift.org/u/anandabits)\
**Post date:** [December 2, 2019, 7:31pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/4 "2019-12-02T19:31:04Z")

</div>

+1. I like the revision. This approach will work for a wider range of users which should help drive early adoption of standard library features, including during the pitch and review phases of SE.

---

<div class="post-metadata">

**Author:** ![SDGGiesbrecht](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/sdggiesbrecht/32/4768_2.png) [@SDGGiesbrecht](https://forums.swift.org/u/SDGGiesbrecht)\
**Post date:** [December 2, 2019, 8:13pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/5 "2019-12-02T20:13:23Z")

</div>

> [@DevAndArtist](#):
>
> It isn't stated as a goal of the proposal but would it be possible to _officially_ , retroactively introduce several preview packages of past proposals?

Given the following, I don’t think it will really be all that helpful for backporting availability constrained APIs. (Which `Result` doesn’t suffer from anyway.)

> In order to keep the size of the `SwiftPreview` package manageable, re-exported proposal packages will be removed from the bundling package in a version update **1 year** after migration to the standard library.

Such an official shim package (or other shimming strategy) would certainly be useful, but I don’t think the preview package is the place for it.

---

<div class="post-metadata">

**Author:** ![benrimmington](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/benrimmington/32/695_2.png) [@benrimmington](https://forums.swift.org/u/benrimmington)\
**Post date:** [December 2, 2019, 10:39pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/6 "2019-12-02T22:39:59Z")

</div>

In the prototype, what is the intended purpose of the [SwiftPreviewTests.swift](https://github.com/apple/swift-evolution/pull/1090/files#diff-4f92ee4ccc083a50aa66eb761d9c9946) file?

---

<div class="post-metadata">

**Author:** ![SDGGiesbrecht](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/sdggiesbrecht/32/4768_2.png) [@SDGGiesbrecht](https://forums.swift.org/u/SDGGiesbrecht)\
**Post date:** [December 2, 2019, 11:04pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/7 "2019-12-02T23:04:47Z")

</div>

Looking at the prototype, why is [the package named `swift-preview`](https://github.com/apple/swift-evolution/pull/1090/files#diff-37ca2dd15ca0f6b1b49e78db084ef5b9R17)? Right now we kind of have an inconsistent mess:

| **Package Name** | **Library Name** |
| SwiftPM | SwiftPM (or SwiftPM-auto) |
| SwiftSyntax | SwiftSyntax |
| swift-format | SwiftFormat |
| cmark | cmark |
| llbuild | llbuildSwift |
| (swift-preview) | (SwiftPreview) |

This will become more apparent when SE‐0226 comes to fruition. (And the PRs are rolling in as we speak! 🎉) From its proposal (emphasis added):

> To achieve this, the package manager needs to associate the product dependencies with the packages which provide those products without cloning them. We propose to make the package name parameter in the product dependency declaration non-optional. This is necessary because if the package name is not specified, the package manager is forced to resolve all package dependencies just to figure out the packages for each of the product dependency. _SwiftPM will retain support for the byName declaration for products that are named after the package name. This provides a shorthand for the common case of small packages that vend just one product._
> 
> ```swift
> extension Target.Dependency {
> static func product(name: String, package: String) -> Target.Dependency
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![nnnnnnnn](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nnnnnnnn/32/264_2.png) [@nnnnnnnn](https://forums.swift.org/u/nnnnnnnn)\
**Post date:** [December 3, 2019, 1:57am UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/8 "2019-12-03T01:57:19Z")

</div>

Nice catch! From that proposal:

> In many cases, the package name and the last path component its URL are the same. Package name can be omitted for such dependencies.

That certainly indicates that the best practice will be to have the repo name match the SwiftPreview package name. I’ll make the requisite changes.

---

<div class="post-metadata">

**Author:** ![jawbroken](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jawbroken](https://forums.swift.org/u/jawbroken)\
**Post date:** [December 3, 2019, 9:22pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/9 "2019-12-03T21:22:16Z")

</div>

> [@SDGGiesbrecht](#):
>
> Given the following, I don’t think it will really be all that helpful for backporting availability constrained APIs. (Which `Result` doesn’t suffer from anyway.)
> 
> > In order to keep the size of the `SwiftPreview` package manageable, re-exported proposal packages will be removed from the bundling package in a version update **1 year** after migration to the standard library.

But you would still be able to import the individual package.

---

<div class="post-metadata">

**Author:** ![SDGGiesbrecht](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/sdggiesbrecht/32/4768_2.png) [@SDGGiesbrecht](https://forums.swift.org/u/SDGGiesbrecht)\
**Post date:** [December 3, 2019, 10:25pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/10 "2019-12-03T22:25:44Z")

</div>

I don’t contest that such official backports would be useful. I just see their purpose as distinct from previews. That not only affects how long you plan to maintain them, it also affects the design in some ways. For example, on platforms not yet declared stable, a backfill would want to hide everything behind `#if !os(Linux)`, etc, so that the standard library always takes over. But that would defeat the purpose of a preview package.

---

<div class="post-metadata">

**Author:** ![jawbroken](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jawbroken](https://forums.swift.org/u/jawbroken)\
**Post date:** [December 4, 2019, 11:34am UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/11 "2019-12-04T11:34:50Z")

</div>

That seems like an assertion, but perhaps I don't understand your point. When packages from the preview package start shipping in the standard library then they become de facto backfill packages. So any concerns that apply to “retrospective preview packages”, i.e. things that probably would have been in the preview package had it existed, seem to apply to this proposal. I'm not necessarily supporting the idea, and I don't personally particularly care about backfilling either way, but I don't understand your arguments against it.

---

<div class="post-metadata">

**Author:** ![Braden\_Scothern](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/braden_scothern/32/1580_2.png) [@Braden\_Scothern](https://forums.swift.org/u/Braden_Scothern)\
**Post date:** [December 4, 2019, 4:55pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/12 "2019-12-04T16:55:47Z")

</div>

I am a big +1 on this approach.

I think it works well for scalability and usability.

---

<div class="post-metadata">

**Author:** ![TommiKivimaki](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tommikivimaki/32/9585_2.png) [@TommiKivimaki](https://forums.swift.org/u/TommiKivimaki)\
**Post date:** [December 9, 2019, 9:41am UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/13 "2019-12-09T09:41:14Z")

</div>

+1 for the proposal. I did a quick read and I do feel that the problem is worth solving. I think the proposal would help with quick adoption of new features.

Versioning gave me mixed feelings first, but after I though about it more I do agree that it will be a good way to handle it.

---

<div class="post-metadata">

**Author:** ![DevAndArtist](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/devandartist/32/287_2.png) [@DevAndArtist](https://forums.swift.org/u/DevAndArtist)\
**Post date:** [January 25, 2020, 6:10pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/14 "2020-01-25T18:10:53Z")

</div>

@tkremenek has the core team decided on this proposal or was it forgotten?

---

<div class="post-metadata">

**Author:** ![tkremenek](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tkremenek/32/9115_2.png) [@tkremenek](https://forums.swift.org/u/tkremenek)\
**Post date:** [January 28, 2020, 2:59am UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/15 "2020-01-28T02:59:43Z")

</div>

The core team has discussed this. There were some details I was figuring out related to the packages themselves. The core team will circle back on this within a couple days.

---

<div class="post-metadata">

**Author:** ![tkremenek](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tkremenek/32/9115_2.png) [@tkremenek](https://forums.swift.org/u/tkremenek)\
**Post date:** [February 4, 2020, 7:09am UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/16 "2020-02-04T07:09:41Z")

</div>

# Proposal Accepted

The proposal has been accepted. The Core Team strongly believes that vending upcoming changes to the Standard Library via "preview packages" distributed using the Swift Package Manager could be a powerful vehicle to get additional signal on the quality of proposed changes to the Standard Library.

The Core Team was satisfied with the dual model of having an umbrella package that users can use to install all available APIs available as preview package, as well as individual packages that correspond to specific evolution proposals.

Each preview package will be housed in a separate repository in the `apple` organization on GitHub, sitting as peers to the other repositories part of the Swift project.

Here is the module name and repository mapping that the Core Team settled on:

| Module Name | Repository |
| --- | --- |
| `StandardLibraryPreview` | `swift-standard-library-preview` |
| `SE<number>_<shortname>` | `swift-se<number>-<shortname>` |

Where `<number>` would be the 4-digit SE number, starting with `0` for proposals less than 1000, and `<shortname>` would be something short like "RangeSet" that is a pithy highlight of what that package covers.

### Some examples

#### Module names

```swift
import StandardLibraryPreview
import SE0270_RangeSet
import SE0261_Identifiable
import SE0251_SIMD
import SE0235_Result

```

### Repository names

- `swift-standard-library-preview`
- `swift-se0270-rangeset`
- `swift-se0261-identifiable`
- `swift-se0251-simd`
- `swift-se0235-result`

## Next steps

Thank you to everyone who participated in this review. The next steps are to create the initial repositories for the preview packages, as well as update [Swift.org](http://Swift.org) with information about the preview packages and their use. An announcement will be made when these changes have been made and the preview packages are available.

---

<div class="post-metadata">

**Author:** ![DevAndArtist](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/devandartist/32/287_2.png) [@DevAndArtist](https://forums.swift.org/u/DevAndArtist)\
**Post date:** [February 4, 2020, 10:07am UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/17 "2020-02-04T10:07:12Z")

</div>

@tkremenek Great news. There are a few that I would like to clarify.

- Would it make sense to introduce some of the past propsed API's as standalone packages which are now part of ABI stable stdlib binaries only?

- For example as you already mentioned `swift-se0235-result`, `swift-se0261-identifiable` and potentially `swift-se0240-diffing`?

- Does it make sense to handle some of the packages in a way like `Swift Crypto` is handled, which will re-import the framework if it's provided by the OS?

---

<div class="post-metadata">

**Author:** ![Nevin](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nevin/32/617_2.png) [@Nevin](https://forums.swift.org/u/Nevin)\
**Post date:** [February 4, 2020, 3:36pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/18 "2020-02-04T15:36:44Z")

</div>

> [@tkremenek](#):
>
> Where `<number>` would be the 4-digit SE number

Any particular reason for stipulating a fixed-width format for the number?

---

<div class="post-metadata">

**Author:** ![tkremenek](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tkremenek/32/9115_2.png) [@tkremenek](https://forums.swift.org/u/tkremenek)\
**Post date:** [February 4, 2020, 3:49pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/19 "2020-02-04T15:49:36Z")

</div>

> [@tkremenek](#):
>
> > Where `<number>` would be the 4-digit SE number
> 
> Any particular reason for stipulating a fixed-width format for the number?

Just so that the order more nicely in a listing, and that they match how SE proposals are typically presented during proposal reviews, etc.

---

<div class="post-metadata">

**Author:** ![tkremenek](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tkremenek/32/9115_2.png) [@tkremenek](https://forums.swift.org/u/tkremenek)\
**Post date:** [February 4, 2020, 3:50pm UTC](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288/20 "2020-02-04T15:50:38Z")

</div>

> [@DevAndArtist](#):
>
> Does it make sense to handle some of the packages in a way like `Swift Crypto` is handled, which will re-import the framework if it's provided by the OS?

In this case, the _framework_ is the Standard Library, which is always imported.

[Next page](https://forums.swift.org/t/se-0264-review-2-standard-library-preview-package/31288.md?page=2)
