Archive for February 22, 2022

Tuesday, February 22, 2022

Swift 5.6 Features in Xcode 13.3 Beta 3

Apple:

Swift now allows existential types written with the any keyword. An existential type is a type that can hold a value of any type conforming to a specific protocol. The any keyword creates a syntactic distinction between existential types and protocol conformance constraints. The any keyword is an important syntactic indicator that you’re using an existential type, because there are fundamental limitations on the capabilities of these types, such as the inability to conform to protocols. [SE-0335]

[…]

Swift now provides an incremental migration path for data race safety. APIs can adopt concurrency without breaking clients that haven’t adopted concurrency. An existing declaration can introduce concurrency-related annotations (such as making its closure parameters @Sendable) and use the @preconcurrency attribute to maintain its behavior for clients who haven’t adopted concurrency[…] [SE-0337]

[…]

The standard library now provides the withUnsafeTemporaryAllocation(of:capacity:_:) and withUnsafeTemporaryAllocation(byteCount:alignment:_:) functions. You can use these functions to cheaply allocate raw storage for a brief duration. The system allocates storage on the stack if possible. [SE-0322]

Previously:

Update (2022-03-07): Paul Hudson:

Swift 5.6 introduces another barrage of new features to the language, while refining others as we get closer to Swift 6. In this article I want to introduce you to the major changes, providing some hands-on examples along the way so you can see for yourself what’s changing.

Git Tower 8

Bruno Brito:

While accessing a branch’s history, you can now toggle the “Compare” icon to compare that branch against a different local branch, so that you only see the commits that have been made on the feature branch.

[…]

By comparing your local branches to a base branch, [the Branches Review] view will help you identify which branches have been stale or become obsolete, so that you can clean up your Git repository with confidence.

[…]

When right-clicking a branch, you will now have the option to pin it. Pinned branches will appear in the new “Pinned” section in the sidebar.

[…]

You can filter branches, tags and submodules using the input field at the bottom of the sidebar.

Previously:

Objective-C Messages to nil

psu:

In the more modern versions of the runtime, the area that the runtime uses to write the result of the method call is zero’d out no matter what the type of the return value will be. In older versions of the runtime you could get into trouble because this “return 0” behavior only worked if the method returned something that was the size of a pointer, or integer, on the runtime platform. And on PowerPC if you called a method that returned a float or double you could get all kinds of undefined suffering.

Anyway, I was having a chat with a nerd friend of mine at work, and we both got curious if this behavior dated back to the original Objective-C runtime or if it was added at some point. With the entire Internet at our fingertips surely this could not be that hard to figure out.

[…]

The long post verifies that the original Objective-C runtimes threw an error told to send messages to nil, and that this was changed to the current fall-through behavior in a release of some software called “ICPack 201”. This package was released by a company called Stepstone, which originally developed and owned the language in the 80s.

Why Lattner Left the Swift Core Team

Chris Lattner (Hacker News):

To answer your question, the root cause of my decision to leave the core team is a toxic environment in the meetings themselves. The catalyst was a specific meeting last summer: after being insulted and yelled at over WebEx (not for the first time, and not just one core team member), I decided to take a break. I was able to get leadership to eventually discuss the situation with me last Fall, but after avoiding dealing with it, they made excuses, and made it clear they weren’t planning to do anything about it. As such, I decided not to return. They reassure me they “want to make sure things are better for others in the future based on what we talked about” though.

On Swift Evolution, my original intention was to continue participating in the forums, but after several discussions generating more heat than light, when my formal proposal review comments and concerns were ignored by the unilateral accepts, and the general challenges with transparency working with core team, I decided that my effort was triggering the same friction with the same people, and thus I was just wasting my time.

[…]

It is obvious that Swift has outgrown my influence, and some of the design premises I care about (e.g. “simple things that compose”) don’t seem in vogue any more.

[…]

I think that Swift is a phenomenal language and has a long and successful future ahead, but it certainly isn’t a community designed language, and this isn’t ambiguous.

I think many initially hoped that Lattner would have a BDFL sort of role, but after he left the company that became incompatible with Apple’s desire to drive the design in support of its private internal plans. At present, the only Core Team member from outside of Apple seems to be Saleem Abdulrasool of Google Brain.

Previously:

Apple Sales Support and UPS

Dave Winer:

I’ve been feeling pretty good lately, but when I have an interaction with Apple, I think seriously I should just write off the $1300 I paid for the iPhone 13 Pro and get a high-end Android phone. I probably won’t because I’m locked in to so many Apple services.

Anyway, 17 days after buying the phone from Apple, $1300 plus tax, it is still not here. UPS says it will be delivered tomorrow, but they’ve said that every day in the last week.

[…]

The person recited some boilerplate saying that Apple will issue the refund when they receive the phone. I stopped her and repeated I don’t have the phone so I can’t return it.

Dave Winer:

I’ve spent hours on the phone with Apple people, tried using the support address on Twitter, and have gotten conflicting advice from Apple people, and they’ve lost the case a couple of times.

Dave Winer:

After trying to get help from Apple Support on Twitter, I wrote an email to Tim Cook, the CEO of Apple. Within an hour of sending the email, I got a phone call from someone in “Apple Retail Executive Relations” who was empowered to blow through the problem. A third iPhone was sent, this time via Fedex, which is, in my experience, much more reliable in this area than UPS.

[…]

There’s not much more to say that isn’t spelled out in the email to Tim Cook, so I’ll just leave it there, except to say at all levels Apple people knew what the right thing to do was, but their system wouldn’t let them do it. That is, until we got to someone who was at most a couple of hops from the CEO, who was empowered to solve the problem.

John Gordon:

Based on my experience with Apple’s one day express shipping I recommend going to Apple Store for iPhone purchase or service. Lots of things are in bad shape now.

Previously:

Authenticator App Clones

Craig Grannell (also: MacRumors):

Kevin Archer is an indie developer who makes Authenticator App by 2Stable, a feature-rich, premium and suitably named take on, well, an authenticator app. There are of course other, similar, apps on the App Store. But he today revealed just how similar.

On Twitter, he claimed another developer lifted text from his app (including a section on Apple Watch support, despite the other app not supporting Apple’s wearable). When testing the app, Archer found a review request during onboarding, which doesn’t appear to align with Apple guidelines. And, naturally, there’s a weekly IAP subscription, because of course there is.

There are more clones that directly lift his copy and that don’t even work.

Previously: