https://dotat.at/@/2026-03-14-eggs.html A few weeks ago I was enjoying a couple of boiled eggs (in the shell, with plenty of salt and pepper, and buttery fingers of toast to dunk into the runny yolk) and pondering how fiddly it is to cut off one end of the shell after boiling compared to eating a poached egg. And I was annoyed because (I thought) I didn't know how to poach eggs. misconceptions For…
https://dotat.at/@/2026-02-24-nsnotifyd-2-4-released.html The nsnotifyd daemon monitors a set of DNS zones and runs a command when any of them change. It listens for DNS NOTIFY messages so it can respond to changes promptly. It also uses each zone's SOA refresh and retry parameters to poll for updates if nsnotifyd does not receive NOTIFY messages more frequently. It comes with a client program…
https://dotat.at/@/2026-02-16-async.html I'm writing a simulation, or rather, I'm procrastinating, and this blog post is the result of me going off on a side-track from the main quest. The simulation involves a bunch of tasks that go through a series of steps with delays in between, and each step can affect some shared state. I want it to run in fake virtual time so that the delays are just…
https://dotat.at/@/2026-01-13-http-ratelimit.html There is an IETF draft that aims to standardize RateLimit header fields for HTTP . A RateLimit header in a successful response can inform a client when it might expect to be throttled, so it can avoid 429 Too Many Requests errors. Servers can also send RateLimit headers in 429 errors to make the response more informative. The draft is in reasonably…
https://dotat.at/@/2026-01-12-hqlr.html A while back I wrote about the linear rate limit algorithms leaky bucket and GCRA . Since then I have been vexed by how common it is to implement rate limiting using complicated and wasteful algorithms ( for example ). But linear (and exponential ) rate limiters have a disadvantage: they can be slow to throttle clients whose request rate is above the limit…
https://dotat.at/@/2025-12-25-shuffle.html Here's a pearlescent xmas gift for you! There are four variants of the algorithm for shuffling an array, arising from two independent choices: whether to swap elements in the higher or lower parts of the array whether the boundary between the parts moves upwards or downwards The variants are perfectly symmetrical, but they work in two fundamentally…
https://dotat.at/@/2025-10-24-tetrapod.html Concrete tetrapods are used to dissipate wave energy in coastal defences. There's a bit of a craze for making tetrapod-shaped things: recently I've seen people making a plush tetrapod and a tetrapod lamp . So I thought it might be fun to model one. I found a nice way to describe tetrapods that relies on very few arbitrary aesthetic choices. Click here to…
https://dotat.at/@/2025-09-14-ratelimit.html Last year I wrote a pair of articles about ratelimiting: GCRA: leaky buckets without the buckets exponential rate limiting Recently, Chris "cks" Siebenmann has been working on ratelimiting HTTP bots that are hammering his blog. His articles prompted me to write some clarifications, plus a few practical anecdotes about ratelimiting email. mea culpa The…
https://dotat.at/@/2025-09-11-cover-letter.html Although it looks really good, I have not yet tried the Jujutsu (jj) version control system , mainly because it's not yet clearly superior to Magit . But I have been following jj discussions with great interest. One of the things that jj has not yet tackled is how to do better than git refs / branches / tags. As I underestand it, jj currently has…
https://dotat.at/@/2025-08-28-strongly-typed.html What does it mean when someone writes that a programming language is "strongly typed"? I've known for many years that "strongly typed" is a poorly-defined term. Recently I was prompted on Lobsters to explain why it's hard to understand what someone means when they use the phrase. I came up with more than five meanings! how strong? The various…
https://dotat.at/@/2025-08-06-p-fast-trie.html Previously, I wrote some sketchy ideas for what I call a p-fast trie , which is basically a wide fan-out variant of an x-fast trie. It allows you to find the longest matching prefix or nearest predecessor or successor of a query string in a set of names in O(log k) time, where k is the key length. My initial sketch was more complicated and greedy for…
https://dotat.at/@/2025-08-04-p-fast-trie.html Here's a sketch of an idea that might or might not be a good idea. Dunno if it's similar to something already described in the literature -- if you know of something, please let me know via the links in the footer! The gist is to throw away the tree and interior pointers from a qp-trie. Instead, the p-fast trie is stored using a hash map organized…
https://dotat.at/@/2025-07-02-cmp.html Here are a few tangentially-related ideas vaguely near the theme of comparison operators. comparison style Some languages such as BCPL, Icon, Python have chained comparison operators , like if min <= x <= max: ... In languages without chained comparison, I like to write comparisons as if they were chained, like, if min <= x && x <= max { // ... } A rule of…
https://dotat.at/@/2025-06-28-boulder.html Here's a story from nearly 10 years ago. the bug I think it was my friend Richard Kettlewell who told me about a bug he encountered with Let's Encrypt in its early days in autumn 2015: it was failing to validate mail domains correctly . the context At the time I had previously been responsible for Cambridge University's email anti-spam system for about 10…
After I found some issues with my benchmark which invalidated my previous results, I have substantially revised my previous blog entry . There are two main differences: A proper baseline revealed that my amd64 numbers were nonsense because I wasn’t fencing enough, and after tearing my hair out and eventually fixing that I found that the bithack conversion is one or two cycles faster. A newer…
https://dotat.at/@/2025-06-08-floats.html A couple of years ago I wrote about random floating point numbers . In that article I was mainly concerned about how neat the code is, and I didn't pay attention to its performance. Recently, a comment from Oliver Hunt and a blog post from Alisa Sireneva prompted me to wonder if I made an unwarranted assumption. So I wrote a little benchmark, which you can…
https://dotat.at/@/2025-06-01-bialetti.html In hot weather I like to drink my coffee in an iced latte. To make it, I have a very large Bialetti Moka Express . Recently when I got it going again after a winter of disuse, it took me a couple of attempts to get the technique right again, so here are some notes as a reminder to my future self next year. It's worth noting that I'm not fussy about my…
https://dotat.at/@/2025-05-28-types.html TIL (or this week-ish I learned) why big-sigma and big-pi turn up in the notation of dependent type theory. I've long been aware of the zoo of more obscure Greek letters that turn up in papers about type system features of functional programming languages, μ , Λ , Π , Σ . Their meaning is usually clear from context but the reason for the choice of notation…
https://dotat.at/@/2025-05-13-if-is.html About half a year ago I encountered a paper bombastically titled "the ultimate conditional syntax" . It has the attractive goal of unifying pattern match with boolean if tests, and its solution is in some ways very nice. But it seems over-complicated to me, especially for something that's a basic work-horse of programming. I couldn't immediately see how to…
https://dotat.at/@/2025-04-30-test.html Recently, Alex Kladov wrote on the TigerBeetle blog about swarm testing data structures . It's a neat post about randomized testing with Zig. I wrote a comment with an idea that was new to Alex matklad , so I'm reposing a longer version here. differential testing A common approach to testing data structures is to write a second reference implementation that…
https://dotat.at/@/2025-03-30-hilite.html I have added syntax highlighting to my blog using tree-sitter . Here are some notes about what I learned, with some complaining. static site generator I moved my blog to my own web site a few years ago. It is produced using a scruffy Rust program that converts a bunch of Markdown files to HTML using pulldown-cmark , and produces complete pages from…
https://dotat.at/@/2025-03-05-lemire-inline.html Last year I wrote about inlining just the fast path of Lemire's algorithm for nearly-divisionless unbiased bounded random numbers . The idea was to reduce code bloat by eliminating lots of copies of the random number generator in the rarely-executed slow paths. However a simple split prevented the compiler from being able to optimize cases like…
https://dotat.at/@/2025-02-13-pcg32-simd.html One of the neat things about the PCG random number generator by Melissa O'Neill is its use of instruction-level parallelism: the PCG state update can run in parallel with its output permutation. However, PCG only has a limited amount of ILP, about 3 instructions. Its overall speed is limited by the rate at which a CPU can run a sequence where the…
https://dotat.at/@/2024-12-30-ioccc.html The International Obfuscated C Code Contest has a newly revamped web site, and the Judges have announced the 28th contest, to coincide with its 40th anniversary. (Or 41st?) The Judges have also updated the archive of past winners so that as many of them as possible work on modern systems. Accordingly, I took a look at my 1998 winner to see how much damage…
https://dotat.at/@/2024-12-05-nsnotifyd-2-3-released.html D'oh, I lost track of a bug report that should have been fixed in nsnotifyd-2.2 . Thus, hot on the heels of the previous release , here's nsnotifyd-2.3 . Sorry for causing extra work to my uncountably many users! The nsnotifyd daemon monitors a set of DNS zones and runs a command when any of them change. It listens for DNS NOTIFY messages…