Machinist

Russ Bishop
February 13, 2026

lathe piling chips
fluffy and soft
these are lies
in the pile
lies only regret

Read More

No Such Thing as Speed of Light

Russ Bishop
February 03, 2026

I'm no physicist particle farmer so take this opinion for what it is worth.

Using the phrase "Speed of Light" is such a misnomer I believe it actively causes harm and makes some things in physics more difficult to understand than they otherwise would be. Why should light's chosen speed have anything to do with, . . .

Read More

String Interpolation

Russ Bishop
October 06, 2022

Swift 5 added some nice improvements to string interpolation that many people may not be aware of.

The first is the ability to control interpolation into a custom type that adopts ExpressibleByStringInterpolation. This allows you to create types like HTML and drives the new OSLog string formatting (eg log.debug("value \(x, . . .

Read More

Cross-process Rendering

Surfaces save us

Russ Bishop
November 05, 2019

The proper way to render across processes on Apple platforms is to use an IOSurface.

Though the headers don't declare it, IOSurface and IOSurfaceRef are toll-free bridged. If calling an API that takes IOSurfaceRef from Swift, use unsafeBitCast(surface, to: IOSurfaceRef.self)

An IOSurface is a kernel-managed . . .

Read More

The Law

Atomics are hard

Russ Bishop
February 25, 2019

Swift 5 turns on exclusivity checking by default. This has some interesting interactions with atomics, especially when running under the Thread Sanitizer (TSAN). If you've ever seen a TSAN report on some simple Swift code that looks obviously correct then you're probably running into this issue:

// Incorrect! Do not use this!
 . . .

Read More

Take Delight in Small Joys

Extensions everywhere

Russ Bishop
November 08, 2018

This is a small post about a small joy. I really enjoy how natural extensions can feel in Swift.

I consider it quite unfortunate that UnsafeMutableRawBufferPointer.baseAddress is optional. It makes that type so ugly to use in practice. I also dislike having to specify alignment on allocation; a sensible default is Int.bitWidth / 8 on . . .

Read More

Fixed-sized Arrays

Who doesn't like a tuple with 1024 elements?

Russ Bishop
October 30, 2018

Let's say we want to statfs() a mount point to determine which BSD device name it belongs to. In english, that means discover that /Volumes/MyDisk comes from /dev/disk6s2.

struct statfs fsinfo;
if (statfs(path, &fsinfo) != 0) {
 //error
}

The equivalent Swift code, along with a POSIX error helper:

func  . . .

Read More

Archive
   Subscribe by email and never miss a post.

This update link alerts you to new Silvrback admin blog posts. A green bubble beside the link indicates a new post. Click the link to the admin blog and the bubble disappears.

Got It!