Finding something local...
01.01.2022

Another year of our never-ending pandemic creeps to it's conclusion. An ebb and flow, but brighter than the last. The promise of the vaccine, the summer slowdown — spent a month on a lake in Wisconsin, took postponed vacations. Canceled others — fall resurgence, delta and omnicron. Said goodbye to our beloved dog, Lily. Bought stacks of books (unopened). Joined the Virtual HQ team at Slack and helped ship Huddles and Clips. Onwards.

Music

TV

Movies

Games

Apps (iOS)

01.01.2021
07.04.2020

Stay inside, we need to plan
wash your hands (happy birthday, twice)
Wear a mask
where’s the plan?
There is no plan, please wear a mask
Public freakout
Just wear a fucking mask!
Zero cases in New Zealand
Fuck New Zealand
fifty thousand cases a day
Fuck America
Used to love Erma Bombeck
on the Fourth
potato salad and flags
Happy Independence Day
but not lately
we should try
to make America great again

06.20.2020

A few years ago as a part of my explorations with Swift, I started statically generating this site using Swift. Now, this was way back in the bad old days of Swift 3, before we had modern conveniences like ABI stability — so when I upgraded my personal laptop this winter, I inadvertently lost the Swift toolchain that I had used to compile my customized fork of Spelt. After a bit of spelunking, I realized that it had been built with some beta version of Xcode long since lost to the sands of time — I was stuck with a binary I couldn’t run.

As Spelt was no longer being actively developed, rather than take the time to convert it to Swift 5 and recompile I used the disruption as an opportunity to move to a newly released Swift static site generator, John Sundell's Publish. Over the course of the week I spent converting this site to use Publish, I was frustrated by a lot of the built-in assumptions and general inflexibility. While I am sure that it is a great Swift by Sundell generator, it is not (yet) a great general-purpose static site generator.

But the beauty of open source is exactly that, so I forked it and fixed my two biggest issues. The first issue is that it insists on using Ink as the Markdown parser. Ink doesn't fully support CommonMark and couldn't correctly parse some of my posts so I added a custom content parser block and replaced Ink with this CommonMark package. This also provided me an entry point where I could add parsing for markdown footnotes1. The second paper cut was the lack of control over paths. The simple fix was to add a new mode for clean links but it would have been nice for a bit more built-in flexibility here.

One of the things about Publish that is technically neat is it's HTML DSL2 Plot. What this means in practice is that you can write HTML in Swift like this:

let body = HTML(
    .body(
        .div(.class("pure-g"),
             .div(.class("pure-u-0-4 pure-u-md-1-12 pure-u-lg-1-4")),
             .div(.class("pure-u-1-1 pure-u-md-5-6 pure-u-lg-1-2"),
                  .header(for: self),
                  .itemList(for: items),
                  .paginator(currentPage: page, context: self)
             ),
             .div(.class("pure-u-0-4 pure-u-md-1-12 pure-u-lg-1-4"))
        ),
        .footer(for: site)
    )
)

Like I said, kinda neat! In practice I found it to be more clunky and mistake-prone than just writing HTML with Mustache templates, which is what I was converting from.

My last complaint is a more general one — Swift generics are still too difficult to use, and the error messages provided by Xcode make them unapproachable for novices and experts alike. I would do everything I could to not expose generics in the API of a library I published.

Above gripes aside, my overall experience was a positive one. The "steps" model used by Publish makes the whole system extensible by design, and the included RSS feed generator step means that this site now has one. I was able to easily add and plug in a S3 deployment method that uses the AWS CLI, which ended up inspiring me to convert the whole process into a Github Action that builds and deploys the site automatically whenever I push to main. Oh, and there's a dark mode theme now.

If you're interested, the full source is available here3.


  1. Included in "extended" markdown syntax.↩︎

  2. Domain-specific language.↩︎

  3. There are a few interesting expansions of Publish's functionality in there like pagination.↩︎

01.01.2020

Had a second kid! Took time off for paternity leave. For the first time since 2016 I didn’t change jobs in September. We didn’t move this year and are happily settling (back) into our life here in Durham, NC.

Shipped some software — I updated my personal website, shipped a macOS Catalina compatibility update for Later and helped build the new App Home surface for Slack. Got interested in gRPC, microservices, and Kubernetes. Remained interested in Swift.

Drank a lot of hazy IPAs.

The rest of my 2019 highlights:1

Books

Music

Apps (iOS)

Apps (macOS)

Games


  1. Listed alphabetically.↩︎