There’s a ton of chatter lately around the expense of AI, with headings like “AI’s real cost problem: Using the tech is more expensive than paying human employees” . Wow, maybe our jobs aren’t in danger! Anyway, I’m not here to express an opinion about clankers replacing humans, that’s for another day. Here I’m just wanting to ask and answer the question: Can you simply run AI locally? If so,…
For real-time audio processing, it is necessary to communicate to your audio thread in such a way that the audio thread can never be blocked. Audio threads are hard-real-time: any delays will lead to loud pops/crackles/echoes. This is proper engineering! Fun! So here’s my take on a simple C Lockless Single-Producer Single-Consumer queue that can be used for this (and other) applications. This…
Recently I made Dopefish Decoder , a Rust tool for dumping the graphics from a very old-school Id software game: Commander Keen 4-6. It was a bit of work (fun work though) combining information from various sources to figure out how to read it all, so here’s the formats in rough EBNF! Further explanations are afterwards for the more complex elements. Files Graphics: graph_head graph_dict egagraph…
A few weeks ago, there was a huge Cloudflare outage that knocked out half the internet for a while. As someone who has written a fair bit of Rust in my spare time (23KLOC according to cloc over the last few years), I couldn’t resist the urge to add some constructive thoughts to the discussion around the Rust code that was identified for the outage. And I’m not going full…
Are you curious to know if upgrading from macOS Sequoia to Tahoe will affect compilation speeds? Everyone seems to be piling onto the anti-Tahoe bandwagon, so I thought I’d add some anecdata to the anecdotes going around. Note that I have two identical laptops, the only difference is that one has Tahoe: Mac macOS Speed (lower is better) --- ----- ----- 2025 M2 Air 16GB RAM Sequoia 15.6 361.54s…
Having worked with React Native projects on and off for years now, I’ve come to appreciate that there are significant productivity and developer experience (devex) gains on the table, that tend to be derailed the moment a native library is added to the mix. But what if you could keep that productivity flowing? Most people (somewhat rightly) think of Expo Go as the training wheels that nobody uses…
FM Synthesis is an old-school way of generating musical instrument sounds, initially popularised by the Adlib and SoundBlaster PC sound cards in the late ’80s (and, of course, in piano keyboards). Here’s an example of what FM Synth music sounded like in games . Ahh the nostalgia. A friend who is a school music teacher found that his students all use the same identical samples for instruments for…
Hi all, here’s the fourth on my series on neural networks / machine learning / AI from scratch. In the previous articles (please read them first!) , I explained how a single neuron works, then how to calculate the gradient of its weight and bias, and how you can use that gradient to train the neuron. In this article, I’ll explain how to determine the gradients when you have many layers of many…
Hi all, I’d like to talk about a way to setup your ViewModels in SwiftUI to make previews easy: A) Decouple your ViewModels from your Views. B) Replace your ViewModel when previewing. C) Easily inject any ViewState content when previewing. D) Test your ViewModels without needing a View, instead testing their ViewState. I’ve used a variant of this (I simplified it a little) with a big team before…
Hi all, here’s the third on my series on neural networks / machine learning / AI from scratch. In the previous articles (please read them first!) , I explained how a single neuron works, and how to calculate the gradient of its weight and bias. In this article, I’ll explain how you can use those gradients to train the neuron. Spreadsheet I recommend opening this spreadsheet in a separate tab, and…