terminal2blink and Swift

I love Blink Shell on iOS. It’s a fantastic ssh/mosh client (and more!) that supports external monitors, too. However, I’ve used Terminal.app on macOS for so long now, that I have it tricked out just the way I like it. This, of course, includes the color scheme. It turns out that Blink Shell is themeable past the built-in themes. It would be a bit of a pain to go though each color setting in Terminal.app, write it down, convert it to hex, and create the proper Blink theme file. So, in a fit of procrastinating from everything else in life, I wrote a utility to do this for you: terminal2blink.

I decided to use Swift because I wanted to give it a spin, and because it feels like Swift foundation has finally settled in: ABI compatibility, and ‘no more’ upheaval. I’d also like to dig into SwiftUI. (So, basically, “I wanted to”.) Looking back at the code, it looks like I carried over some Python habits into the code. Maybe? Are we still figuring out what idiomatic Swift looks like? I haven’t been around Swift code long enough to know what that is, exactly. I do want that to change. I’m on the hunt for current (read: Swift 5) books and tutorials. Recommendations welcome: get me at @marczak on Twitter. (I already have the Daniel Steinberg Suite.)

So far, Swift is…interesting. It relies on Apple’s Cocoa and Foundation for a lot of functionality, rather than building it into the language. That makes a certain amount of sense. It’s open source, but I have no gauge of how much it’s used on non-Apple platforms.

One thing I’d love to see from Apple: better documentation. I mean, Apple docs have come a long way, but why not give examples? Microsoft had this one down ages ago. Look up a class/method/function, get a description, and then some code to show how it’s used. Such a basic teaching principle. Yes, it’s work, but wow would it make things better for developers on Apple platforms, and I suspect make new ones for the platform. (It’s never the language, but the API, right?)

I hope to keep this momentum up, so, perhaps I’ll see what Swift looks like running under Linux, just for a different perspective.