Bouke van der Bijl

The M1 MacBook Air is the best computer I've ever owned

I started a new job recently so I had the opportunity to get one of the new M1 MacBooks, I decided to go with the Air. The reviews have been very positive and I’m here to tell you: it is indeed an amazing device. The performance feels a lot better than my MacBook Pro 16”, which is only a year old and about 3x the price.

When I got the Mac I set out with the goal of avoiding Intel builds of software as much as possible and using native whenever possible unless it’s absolutely impossible.

Nix

I have my whole system configuration stored in Nix, which was the thing that I least expected to work and arm64 support is still a work in progress. I could install the x86_64 build of Nix and run it under Rosetta but wanted to avoid that, so I went back to my old pal;

Homebrew

This was one of the first things I installed and got working, when I did it I had to install it into /opt/homebrew manually and install everything with the --source flag but… everything mostly worked? Lots of props to the Homebrew team for getting everything running so quickly, with some amazing open-source project management the community worked together very quickly to support most of the software that Homebrew offers. There’s still some software that doesn’t work—notably neovim. But I’m sure that will be fixed soon.

The installer now installs into /opt/homebrew by default and there’s prebuilt bottles of most packages, so the Homebrew experience is great.

Go

A lot of my work involves Go, and I depend on a lot of tools written in Go. I was happy to see that the Go team was on top of it and released the 1.16 beta quite quickly, which is what is installed right now when you do brew install go. I’ve had no issues with it and am enjoying some of the new features like file embedding. GoLand was also updated to support M1 pretty quickly.

Terraform

Terraform I had the most issues with since using it depends on a bunch of plugins, which are generally only available for x86_64. This won’t change until Go 1.16 has been released. So here I had to resort to building for x86_64, which is easy to do:

curl -L 'https://github.com/hashicorp/terraform/archive/v0.14.4.tar.gz' | tar -xzf-
cd terraform-0.14.4/
GOARCH=amd64 go build -o ~/bin/terraform

And now Terraform will just use plugin built for Intel. I assume that most Terraform plugins will support arm64 very quickly after Go 1.16 is out.

Rust and Universal Binaries

I use Alacritty as my terminal. It supported arm64 pretty quickly but the current build for it doesn’t include it. Creating a universal binary for Rust is quite easy:

rustup target add x86_64-apple-darwin aarch64-apple-darwin
cargo build --release --target=x86_64-apple-darwin
cargo build --release --target=aarch64-apple-darwin
lipo target/{x86_64,aarch64}-apple-darwin/release/alacritty -create -output alacritty

Running file alacritty will now show you something like:

alacritty: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
alacritty (for architecture x86_64):    Mach-O 64-bit executable x86_64
alacritty (for architecture arm64):     Mach-O 64-bit executable arm64

Now you can run it in either x86_64 mode with arch -x86_64 alacritty or natively with arch -arm64 alacritty and the OS will automatically select the right binary.

Building a universal binary for a Go application is similarly easy:

GOARCH=amd64 go build -o app_amd64 main.go
GOARCH=arm64 go build -o app_arm64 main.go
lipo app_{amd64,arm64} -create -output app

Windows and Games

There’s a couple of games I’ve been playing for a long time that I still need on any computer I get, but they’re 32-bit Windows-only. This was something that was surprisingly easy to get working:

  1. Install the Parallels Technical Preview
  2. Sign up for Windows Insider and download the Windows 10 on ARM Insider Preview
  3. Install it into Parallels
  4. Done

Now you can download Steam and basically install anything and it will probably work. Microsoft really did some amazing magic in getting both 32-bit and 64-bit x86 programs running on arm64.

Conclusion

Somehow Apple has created the best PC in every category at once. It is even the best Windows PC, despite the multiple layers of emulation that are happening. The battery life is incredible, I haven’t experienced any slowdowns, I don’t hear any fans spin up (because there are none). It’s hard not to be excited about this.

If Apple chose to go down this path, they could dominate the server space if they took their magic chips, put it in a rack unit and made it easy to install Linux onto it. Intel is completely screwed unless they come up with something better, fast.

Jan 2021