Deprecating scripting

A couple of days ago, I sent out an intemperate tweet.

Fuckers



  — Dr. Drang (@drdrang) Tue Jun 4 2019 6:55 PM CDT

The screenshot is from the Xcode 11 beta release notes, which I learned about from Michael Tsai. I didn’t credit Michael in the tweet because I thought a one word tweet got my point across better. Also, I wasn’t sure he’d want to be associated with that one word. Michael’s own response was typically spot-on:

This is a big deal in terms of philosophy; Apple once touted the built-in Unix tool suite as a Mac advantage. And it also means lots of practical changes; installers and AppleScripts can no longer lean on other scripting languages.

I’d like to say that this is consistent with Apple’s tendency in the ’10s to distance OS X/macOS from its NeXT and Unix roots, but there really hasn’t been any consistency. On the one hand, a few years ago Apple moved all its online manpages to the legacy section of its developer web pages.1 More recently, it removed them entirely. On the other hand, Apple just announced that it was shifting the default shell in Terminal from bash to zsh,2 which indicates at least some remaining interest in macOS’s Unix underpinnings.

My guess is that the zsh thing is an anomaly and that Apple will continue to cover up the Darwin layer, like a nouveau riche banker trying to hide all traces of his horse thief grandfather.

The bad takes that came in response to my tweet took two forms:

The first came from people who apparently don’t know that I was using Linux as my regular professional desktop OS back when they were still crying over the death of their Tamagotchi. They can be dismissed immediately.

The second has a lot of truth in it but is still a bad take. One of the great values of Apple providing scripting languages with macOS is to make it easy for regular users to turn themselves into occasional scripters. People who program all the time seem to forget how terrifying the idea of writing code is to those who’ve never done it before. Even “power users” quail at the idea of scripting until they’ve done it a few times and survived. If the first step in learning to script is Install Python via Homebrew3, they are simply going to pass.

These new scripters don’t care, for example, that the Apple-supplied Python is out of date, and there’s no reason for them to. Python 2.7 is a perfectly good starting point, as is Perl 5.18 and Ruby 2.3.

Removing scripting languages also means that those of us who know how to use them can’t send scripts to our friends to help them automate their tasks. I’m perfectly happy to “slum” in Python 2 (oh dear, I have to use the format function instead of f-strings) if that’s what it takes.

I suspect that Apple will have some standard way of installing scripting languages, probably through Command Line Tools, so developers will be able to quickly get their old scripts back up and working after the languages are removed. That would be good, but not if it gets installed through a .dmg download and a .pkg file. The only way to make the installation tolerable to regular users is to have it done through the App Store.

Or rather than going through all that trouble, maybe just leave the scripting languages where they are.

Update Jun 7, 2019 7:36 AM
A few people have suggested that Apple may be planning on all of us using Swift as our scripting language. I wouldn’t be surprised that Apple is thinking this way, but if so it’s a horrible idea. Swift is about as likely to break out of the Apple garden as Objective C was; it will never have the widespread popularity and applicability of Perl/Python/Ruby.

On Twitter, @idcrook pointed out that the installation script for Homebrew is built on Ruby, so the people who said “just do brew install perl python ruby” have a bootstrapping problem. No doubt the Homebrew people will start making a workaround and will have it ready in time for the rubipocalyse, but I’m sure it’s a job they wish they didn’t have to do.


  1. The URLs looked like this:

    https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/man.1.html 

  2. Despite the hoopla, I’ve never been a big fan of zsh. It’s biggest advantage over bash seems to be saner scripting, but I think people who script in the shell—any shell—are masochists. 

  3. Or Anaconda or MacPorts or whatever.