

Issue #190
source link: https://swiftweeklybrief.com/issue-190/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Issue #190 29 Jul 2021
Written by: Kristaps Grinbergs
Thank you Jeroen for covering last week’s issue. If you want to contribute or write an issue, head down to our contributions guide or let me know personally.
The slow summer trend is also continuing these past two weeks. Despite that, there are a bunch of accepted proposals and some fresh ideas on the Swift forums.
As always, I appreciate your support. Now let’s get to the news.
Sponsored Link
Free Training Course for Mid/Senior iOS Devs
From August 2nd to 8th you can join a FREE crash course for iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer!
iosacademy.essentialdeveloper.com/p/ios-architect-crash-course-swb2dfd/
Starter tasks
- SR-14941 Introduce compiler warning for leading-zero octal notation
- SR-14943 [Compiler] Fix-it for changing unsafeBitcast to unsafeDowncast should be more narrow or removed
- SR-14971 [Compiler] Spurious error after wrapped ‘var’ declaration without type annotation.
News and community
Great article about using tuples in complex sorting operations in Swift.
Accepted proposals
SE-0319 Never as Identifiable was accepted.
Feedback from the review was positive, and mostly focused on further exploration of making
Never
a true bottom type, or similar alternatives to expanding the list of protocolsNever
conforms to in a systemic manner. The core team acknowledges this is an interesting design space and encourages follow up proposals exploring it.
SE-0317 Async Let was accepted.
A significant area of feedback during the review was that of the creation of implicit suspension points when an
async let
variable is not awaited on a path that exits a scope that is not itself an awaited function. This creates an exception to the rule that suspension points are always marked with anawait
.After thorough discussion of the alternatives to implicit suspension points, the core team feels that language-level solutions add more complexity than is warranted to eliminate implicit suspension points.
The core team acknowledges that this exception may have more impact in practice than can be reasoned about without real-world use. There is an opportunity to react to real-world feedback in Swift 6 by tightening up the model around implicit awaits if it turns out that they are harmful in practice (although it is not currently the intention to do so).
The proposal authors have added descriptions of other solutions and their downsides to the alternatives considered section of the proposal. This section also has additions covering other alternatives discussed during the review, such as the use of property wrappers for a partial library-level solution.
SE-0315 Type placeholders was accepted.
Support for the added functionality was unanimous; there was some discussion about whether the proposal might be better titled “type placeholders” or “inferred types”, but that would not affect the behavior of the feature within the language. Thanks to everyone who participated in the review!
SE-0314 AsyncStream
and AsyncThrowingStream
second review was accepted.
The proposal is accepted. After much discussion, Core Team has decided to retain the
AsyncStream
andAsyncThrowingStream
names as proposed.
Returned proposals
SE-0318 has been returned for revision.
The feedback from the review highlighted further refinement that can be done to the ergonomics of the proposed solution including the templating system. For example, the proposal can make it clearer why a new command is desired compared to enhancing the existing package init command, and explore a templating system that supports for multi-template-single-repo and programatic interfaces.
The proposal authors are encouraged to consider these alternative design ideas, and pitch a modified version of the proposal to the community.
Swift Forums
Gutley pitched an idea to implement a solution to catch unwanted uses of ~=
on OptionSet.
Johannes Auer pitched a proposal to add AsyncValue
.
While migrating a project to the new async features of Swift I constantly needed a mechanism for a synchronization point based of the availability of some value. As far as I can tell, currently there is nothing in the stdlib to cover this.
Basically, this is something like an ‘AsyncSequence’ with only 1 value.
Michael Housh shared a story about exploring Swift web frameworks.
Jonathan G. pitched an idea to add sub-syntax for string literals.
The idea is a new feature for multi-line string literals that allows the user to specify what format the nested content should conform to. Swift would provide a String.Syntax enumeration that would allow the programmer to choose amongst a wide range of existing formats to designate the string content as conforming to.
Ashley Garland started a thread about improving Swift’s user experience from the command line across all platforms.
I’d like to make the command line interface more appropriate for direct, interactive use by humans, while keeping automation use cases available. I propose to rework the CL tools in the following ways:
- Give users direction in accomplishing their Swift tasks at the command line, providing choices for high level tasks and > * clarification about what to do next where possible.
- Progressively disclose flags and options, keeping text focused on the current task.
- Make the command line aware of context so it can infer the right action for impactful cases.
- Continue to provide explicit invocations for all of the tasks we perform today.
Not a Kitteh pitched an idea to add a testable
visibility specifier instead of internal
for @testable
.
@testable
is a very useful feature, however I’ve recently had several bugs caused by accidentally accessinginternal
symbols, or rather, by forgetting to declare symbols in a frameworkpublic
.So, I’m wondering if it was a mistake to make
@testable
allow access to all symbols withinternal
visibility, and whether it should be changed to just provide access to symbols that are explicitly marked with a specialtestable
visibility.For all other intents and purposes,
testable
would be identical tointernal
. The only difference would be that@testable import
only makestestable
symbols accessible, all symbols marked asinternal
stay in-accessible.
Finally
Recommend
-
35
健康 - @wqsfree - #### 昨天下午突然开始头晕恶心,就预感到可能血压高了,5 点半下班赶紧去了医院量了血压,大夫说血压怎么这么高,开了点降血压的药,今天感觉舒服点了。#### 平常在公司也挺清闲的,基本也不加班,
-
9
Tuesday, 22 December 2020 10:05 Macquarie Telecom expands debt facility to $190 million Featured By Peter...
-
12
Episode 190 – Microservices with Sean WhitesellPodcast: Play in new window |
-
5
22:32 以太坊未确认交易为190,413笔 消息,据OKLink数据显示,以太坊未确认交易190,413笔,当前全网算力为502.47TH/s,全网难度为6.71P,当前持币地址为58,361,200个,同比增加315,604个,24h链上交易量为3,446,173....
-
9
This story is part of a group of stories called Only the best deals on Verge-approved gadgets get the Verge Deals stamp of approval, so if you're looking for a deal on your next gadget or gift from ma...
-
12
wocintech stock - 190 Women of Color in Tech stock images take 2
-
3
这里记录每周值得分享的科技内容,周五发布。 本杂志开源(GitHub: ruanyf/weekl...
-
6
销售额激增190%!美国对“清洁湿巾”需求暴涨!
-
9
The company details its company-wide Windows 11 rollout Microsoft is still rolling out Windows 11 to eligible devices out there, but just like any big company, it has also started the process o...
-
4
MacroStrategy Buys $190 Million Bitcoin – Trustnodes MacroStrategy Buys $190 Million Bitcoin – Trustnodes MicroStrategy’s subsidiary MacroStrategy announced the purchase of 4,167 bitcoins in a filing with the Securities and Ex...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK