Archive for March 16, 2022

Wednesday, March 16, 2022 [Tweets] [Favorites]

Swift 5.6 Released

Ted Kremenek:

Swift 5.6 enhances the language through a number of proposals from the Swift Evolution process, including:

  • SE-0290 - Unavailability Condition
  • SE-0315 - Type placeholders (formerly, “Placeholder types”)
  • SE-0320 - Allow coding of non String / Int keyed Dictionary into a KeyedContainer
  • SE-0322 - Temporary uninitialized buffers
  • SE-0324 - Relax diagnostics for pointer arguments to C functions
  • SE-0331 - Remove Sendable conformance from unsafe pointer types
  • SE-0335 - Introduces existential any
  • SE-0337 - Incremental migration to concurrency checking

Nick Lockwood:

I have very mixed feelings about the introduction of the any keyword for protocols in Swift[…]

Of all the changes in recent memory, this is probably the most disruptive to code compatibility (yes, technically it’s only a warning, but warnings matter)

[…]

I don’t necessarily disagree that this makes it clearer what’s going on, but aside from the effect on existing code, it impacts API compatibility forevermore.

A common refactor as APIs evolve is to convert concrete types in the interface to protocols (e.g. to make them testable)

That used to be a mostly non source-breaking change, but now it would require all call sites to be updated.

Previously:

Update (2022-03-23): Steve Troughton-Smith:

This is a pretty crummy bug to ship

Daniel Martín:

Xcode 13.3 has a new tool, xcdebug, which allows you to quickly debug programs or Xcode schemes from a Unix shell.

Update (2022-04-11): TheCodingart:

FB9963451 Has been filed due to a bug found in Swift 5.6 when compiling enums with mixed associated types (some with and some without associated types) causing exponentially large compilation time increases.

Ole Begemann:

I can bring macOS to beachball on an M1 Pro by building the Swift compiler in Terminal. It’s great that this uses all 10 cores at 100%, but it seems the scheduler should leave some cycles to other apps?

Toomas Vahter:

Therefore, when reading about existential any it is possible that we get a feeling like we should, because of performance, replace everything, what is possible, with generics. But that should not be a case. Performance becomes relevant only in areas where we need to call a loooot of functions in a very short time.

Removing Dead Batteries From the Python Standard Library

PEP 594 (via Hacker News):

Back in the early days of Python, the interpreter came with a large set of useful modules. This was often referred to as “batteries included” philosophy and was one of the cornerstones to Python’s success story. Users didn’t have to figure out how to download and install separate packages in order to write a simple web server or parse email.

Times have changed. With the introduction of PyPI (née Cheeseshop), setuptools, and later pip, it became simple and straightforward to download and install packages.

[…]

On the other hand, Python’s standard library is piling up with cruft, unnecessary duplication of functionality, and dispensable features.

[…]

The modules in this PEP have been selected for deprecation because their removal is either least controversial or most beneficial.

I’m going to miss cgi/cgitb. It’s not high-performance, but it’s simple and easy to deploy an endpoint with a single file. There doesn’t seem to be an obvious replacement.

Update (2022-03-23): Jake Edge (via Hacker News):

Comparing that table with the one in our article on the introduction of the PEP shows that the broad strokes are the same, but the details have changed somewhat. The removals were meant to be largely non-controversial, so if good reasons to keep a module were raised—and the maintenance burden was low—it was retained.

Chris Siebenmann:

Some of our CGIs are purely informational; they present some dynamic information on a web page, and don’t take any parameters or otherwise particularly interact with people. These CGIs tend to use cgitb so that if they have bugs, we have some hope of catching things. When these CGIs were written, cgitb was the easy way to do something, but these days I would log tracebacks to syslog using my good way to format them.

[…]

Others of our CGIs are interactive, such as the CGIs we use for our self-serve network access registration systems. These CGIs need to extract information from submitted forms, so of course they use the ever-popular cgi.FieldStorage class. As far as I know there is and will be no standard library replacement for this, so in theory we will have to do something here. Since we don’t want file uploads, it actually isn’t that much work to read and parse a standard POST body, or we could just keep our own copy of cgi.py and use it in perpetuity.

Chris Siebenmann:

Unfortunately there are some dark sides to cgi.FieldStorage (apart from any bugs it may have), and in fairness I should discuss them. Overall, cgi.FieldStorage is probably safe for internal usage, but I would be a bit wary of exposing it to the Internet in hostile circumstances. The ultimate problem is that in the name of convenience and just working, cgi.FieldStorage is pretty trusting of its input, and on the general web one of the big rules of security is that your input is entirely under the control of an attacker.

SuperDuper 3.6

Dave Nanian:

This release is especially important for Apple silicon users. macOS 12.3 will break SuperDuper! v3.5 due to problems with asr (Apple Software Restore), the tool that must be used to copy the OS, and we’ve worked around that issue in our new update.

[…]

We’ve also improved performance, especially when cleaning up folders with fewer files in them during Smart Update; updated our handling of “Cloud” files on Monterey; fixed a crash with new-style serial numbers on macOS versions before 10.14; worked around some security prompts when running from non-Admin accounts…

[…]

As I wrote before, if you get a “Resource Busy” error during an Erase, then copy error under Big Sur and later, it’s likely your Mac fell asleep during the copy, even though we asked it to stay awake (and even if it looks like it didn’t). You can usually fix this by installing Coca from the App Store (it’s free!) and using it to keep the Mac awake during this process. Ensure you “Activate” it using its menu extra.

Previously:

Wordle Implemented in Google Sheets

sajadmh (via Hacker News):

This game utilizes a hybrid of formulas/conditional formatting and Google Apps Script.

Douglas Vaghetti (Hacker News):

What makes Wordle special is not the core mechanic itself, but the series of very intelligent decisions that were made around this very simple (but still fun) core mechanic.

Previously: