Musings

A collection of writings on whatever I find interesting enough to share


Swift Lookbehinds via Reverse Matching Part 2
Jul 10, 2024 • 86 minute(s)

Part 1 Had a video call with Michael and was able to figure out what I need to do. I was actually pretty spot on with what reverse matching is supposed to be (I mean the name kind of says it all), but what I inferred from his suggestion is that my approach is inefficient. Instead of performing a reversing operation on the entire AST, his suggestion was to implement reverse variants of the following instructions: matchScalar, matchBitset, matchBuiltin, matchAnyNonNewline, and advance.

Continue reading ...
Swift @ WWDC 2024
Jun 14, 2024 • 7 minute(s)

Another year, another WWDC. Here are my notes on improvements to the Swift language from watching the various keynotes and sessions.

Continue reading ...
Swift Lookbehinds via reverse matching
Jun 12, 2024 • 2 minute(s)

A month or two ago I discovered that Swift’s fancy new regex builder and regex literals didn’t support lookbehinds, a feature I wanted for a project I’m working on. I decided to see what it would take to implement it myself and slowly worked my way to a (sort-of) (mostly) working initial implementation. Michael Ilseman (one of the original authors of the Swift 5. 7 regex work) has been kindly giving me pointers that were essential for getting as far as I have. In his eyes, the core concept behind lookbehinds, is reverse matching. This is the focus of this scratchpad.

Continue reading ...
A Brief Introduction
Jun 10, 2024 • 3 minute(s)

I’ve been thinking about starting a blog of sorts for a few years now. Blog might be too strong of a term for what I have in mind so perhaps it’s better to call these posts “musings” since that’s what I’m expecting them to be. Musings on various topics that I find interesting, projects I’m working on, cool tech I’ve discovered, and maybe even some structured notes on problems I’m trying to solve. I’m not a particularly good writer so to any writing/grammer connoisseurs out there: you’ve been warned.

Continue reading ...