Archive for August 27, 2024

Tuesday, August 27, 2024

Migrating KeyboardKit to Swift 6 Language Mode

Douglas Hill (tweet):

Over the weekend, I updated KeyboardKit to full data race safety with Swift 6 language mode. KeyboardKit is my open source framework that‘s the easiest way to add comprehensive hardware keyboard control to an iPad, iPhone, or Mac Catalyst app.

This is a great test case because KeyboardKit is a small UI framework that doesn’t perform any slow operations, so all its code is intended to be run on the main thread. It should be trivial to opt into strict concurrency. I didn’t want to spent more than about an hour on this.

Many issues were resolved simply by annotating types with @MainActor, but I wanted to share three interesting situations that came up in the migration, two of which seem like issues on Apple’s side.

[…]

No data race safety issues were exposed.

Previously:

Marlinspike on Agile and Security

Brandon Vigliarolo (Hacker News):

Marlinspike opened the second day of Black Hat with a talk that was ostensibly supposed to be a fireside chat with Black Hat founder Jeff Moss, but the Signal founder stole the show with an opening chat laying out a case for reclaiming the “magic” of software development that’s been lost after 20 years. That loss, he argued, was due to stuffing developers into “black box abstraction layers” that strip them of the freedom needed to be innovative.

[…]

Instead of allowing developers to operate from the bottom up in a way that lets them combine engineering expertise with the vision to see new capabilities in existing technology, agile teams end up siloed, working separately from each other, and without much visibility into what other teams are doing, he argued.

[…]

While software engineering has spent the past few decades struggling to become quicker, more flexible and, by extension, more abstracted, security researchers have been doing the opposite, said Marlinspike.

Irreal:

He blames its current deplorable conditions on Agile but what he really means is layers and layers of abstraction that prevent the developer from understanding what is really happening with their software.

[…]

The difficulty is that our corporate industry leaders love this stuff because it enables them to produce loads of software faster and easier. The problem is that no one, including the developers, really understand what it’s doing. The result is exploit after exploit. And, as Marlinspike says, a lack of joy on the part of those writing the software.

smokel:

Here's a theory on why (some form of) Agile is problematic: Subdividing work into smaller parts is typically beneficial. However, in computer programming, this approach often fails because even the smaller tasks require some creativity, and unexpected challenges are likely to arise.

The person who did the subdividing gains a lot of insight while breaking down the larger problem. However, when transferring a portion of the work to a developer, much of this knowledge is inherently lost. The developer must then devise a creative solution, and lacking the necessary information, may either come up with a suboptimal solution or need further communication with the original architect.

There is no clear-cut solution. Some might argue for more experienced developers who have all the necessary knowledge readily available in their heads. Others might advocate for better design diagrams and documentation to capture all the relevant information. Ultimately, it requires careful consideration, or luck, to strike the right balance. But the dogmas of Agile certainly aren't helping much.

See also: Peter Naur and ncharity.

Previously:

The NeXT IPO That Never Happened

Hansen Hsu (2017, via David Kopec):

Had Steve Jobs’ first company not bought his second, history likely would have been very different. Apple might not exist today. No iPhone. But what could have happened to NeXT? Former NeXT software leader and then-Apple Senior VP of Software Avie Tevanian has donated to the Computer History Museum a historic document that hints at this alternate history: a draft of a November 1996 S-1 SEC statement, never completed or submitted, declaring that NeXT was planning to issue an initial public offering of 5 million shares of common stock.

[…]

Although NeXT’s business in 1996 was about evenly split between its existing OPENSTEP business and WebObjects, Jobs and the NeXT executives believed the WebObjects business would grow much faster than the steadily growing OPENSTEP business and eventually become a majority of its sales.

None of this ever happened. While Jobs was preparing for the NeXT IPO by developing the S-1 disclosure, his first company, Apple, was sinking.

The Insane Engineering of the Game Boy

Real Engineering (via John Gruber):

The original Gameboy was launched in 1989 and was received with mixed reviews. While its success is ingrained in our cultural memory now, when it was launched it was a technologically inferior product. The Gameboy was designed to be a cheap, low-powered, portable gaming system. It was limited in many ways. No backlight for the screen and incredibly low installed memory available for coding games. Review magazines of the time viewed these features as a negative, but these compromises in design were exactly why the Gameboy succeeded. This was a console for the masses. Even with these limitations, engineers and programmers came up with ingenious methods to create games that have not only stood the test of time but launched some of the most valuable franchises in the history of the entertainment industry, TV shows, movies, toys, and even theme parks.

Previously: