Issue #105 23 Mar 2018
Written by: Tapan Thaker
Hello again! 👋 This week Apple announced the WWDC 2018 which will be held from June 4-8 in San Jose, CA. Doug Gregor and Ben Cohen discussed some insights on the Swift 4.1 release on Swift Unwrapped.
- SR-7083 [Compiler]
lazyproperties can’t have observers
- SR-7053 [Package Manager] SwiftPM command line autocompletion script for
zshproduces error: “invalid option definition:…” on completion
- SR-7015 [Compiler] The CoreFoundation conditional downcast diagnostic is not as helpful as it should be
- SR-6982 [Compiler] Improve internal compiler consistency
50: Swift 4.1 with Doug and Ben (part 1): Jesse and JP discuss Swift 4.1 with Ben Cohen and Doug Gregor from the Swift team.
News and community
Commits and pull requests
“Random seeding” means that
hashValueproperties will return different values on each execution of a Swift program. This is an important tool for improving the reliability of the Standard Library’s hashing collections,
Dictionary. In particular, random seeding enables better protection against (accidental or deliberate) hash-flooding attacks.
The proposal is accepted with revisions. The specific changes to the proposal as reviewed are:
@objcenums defined in Swift will receive automatic synthesis of the list of all cases. […]
- Unavailable cases will not be listed, because values of an unavailable case cannot exist in a well-typed Swift program (in breaks the availability model).
- Automatic synthesis is only provided when the conformance is stated on the enum definition (not an extension) [… ]
- The protocol, associated type, and property are named
allCases, respectively. The core team felt that these names reflect the primary use case of this protocol, promoting better clarity for most code that iterates over all of the cases. We chose
Enumerablehas some incorrect connotations (e.g., the
Proposals in review
This proposal will essentially be accepted as is — except for the name for
@abiPublic. Many people voiced concern for this name. While it technically is accurate, it exposes the term “abi” which will be foreign to many. It also doesn’t connote the full implications and value of adding the attribute.
The second review is a follow up to the original review based on feedback on the thread and from the Core Team.
I personally think it is time to standardize Result, and I believe that several other core team members feel the same way. The major problem with doing so is that is blocked by an unresolved disagreement (in both the core team and community): whether Swift should support typed errors.
Ankit Aggarwal & Daniel Dunbar proposed Package Manager Extensible Build Tools. This will allow community build tools (Sourcery, SwiftLint, Jazzy, etcetera) to integrate with the Swift Package Manager. You can contribute & follow the discussion on the Swift Forums.
This is a proposal for adding package manager support for extensible build tools, i.e. executing tools at build time which were themselves produced by some other package, and whose behavior the package manager does not understood directly, but rather interacts through a well-defined, Swift, protocol.
We expect this behavior to greatly enhance our capacity for building complex software packages.
This new mode takes the set of files that would normally be (incrementally) compiled with individual subprocesses, and assigns them dynamically to multiple batches (one per core), compiling each batch with a single process. This means that incremental mode is still operative, and compilation makes use of multiple cores, but the benefits of whole-module mode (fewer processes, less redundant work) also apply.
Using an operator to provide feedback on the context of a failed unwrap has become a commonly implemented approach in the Swift developer Community. What are your thoughts about adopting this widely-used operator into the standard library?
Dictionary.init(uniqueKeysAndValues😃crashes on duplicate keys. While I can understand the reasoning to throw somehow on a collision, nothing about the name makes it feel “unsafe.” I’d hope the type system would have my back and use
throwsfor these kinds of things.