Full Width [alt+shift+f] Shortcuts [alt+shift+k]
Sign Up [alt+shift+s] Log In [alt+shift+l]
52

Advent of Code in C++ Template Metaprogramming

from Posts on Made of Bugs [alt+shift+b] in technology

This December, the imp of the perverse struck me, and I decided to see how many days of Advent of Code I could do purely in compile-time C++ metaprogramming. As of this writing, I’ve done two days, and I’m not sure I’ll make it any further. However, that’s one more day than I planned to do as of yesterday, which is in turn further than I thought I’d make it after my first attempt.
8th Dec 2023

Stay updated

Get a weekly newsletter with the top 5 articles worth reading every week.

More from Posts on Made of Bugs

From error-handling to structured concurrency

How should we think about error-handling in concurrent programs? In single-threaded programs, we’ve mostly converged on a standard pattern, with a diverse zoo of implementations and concrete patterns. When an error occurs, it is propagated up the stack until we find a stack frame which is prepared to handle it. As we do so, we unwind the stack frames in-order, giving each frame the opportunity to clean up or destroy resources as appropriate.

23rd Mar 2026 • 1 votes
Solving Regex Crosswords with Z3

For a while now, I’ve been fascinated by Z3 and by SMT solving more broadly. While on pat leave recently, I was reminded of the existence of regular-expression crossword puzzles, and allowed myself to get nerdsniped by writing a Z3-backed solver. I expected to spend perhaps an afternoon cranking out a quick solver; I ended up getting sucked into understanding and debugging Z3 performance, and learning far more about Z3 and about SMT than I expected.

21st Oct 2025 • 1 votes
The ITTAGE indirect branch predictor

While investigating the performance of the new Python 3.14 tail-calling interpreter, I learned (via this very informative comment from Sam Gross) new (to me) piece of performance trivia: Modern CPUs mostly no longer struggle to predict the bytecode-dispatch indirect jump inside a “conventional” bytecode interpreter loop. In steady-state, assuming the bytecode itself is reasonable stable, modern CPUs achieve very high accuracy predicting the dispatch, even for “vanilla” while / switch-style interpreter loops1!

4th Jul 2025 • 1 votes
Performance of the Python 3.14 tail-call interpreter

About a month ago, the CPython project merged a new implementation strategy for their bytecode interpreter. The initial headline results were very impressive, showing a 10-15% performance improvement on average across a wide range of benchmarks across a variety of platforms. Unfortunately, as I will document in this post, these impressive performance gains turned out to be primarily due to inadvertently working around a regression in LLVM 19. When benchmarked against a better baseline (such GCC, clang-18, or LLVM 19 with certain tuning flags), the performance gain drops to 1-5% or so depending on the exact setup.

9th Mar 2025 • 62 votes
Building personal software with Claude

Earlier this month, I used Claude to port (parts of) an Emacs package into Rust, shrinking the execution time by a factor of 1000 or more (in one concrete case: from 90s to about 15ms). This is a variety of yak-shave that I do somewhat routinely, both professionally and in service of my personal computing environment. However, this time, Claude was able to execute substantially the entire project under my supervision without me writing almost-any lines of code, speeding up the project substantially compared to doing it by hand.

27th Jan 2025 • 71 votes

More in technology

Edge Is Pretending to Be Chrome

I don't think there was any official announcement, but I'm pretty sure Microsoft is secretly trying to trick you into using Edge. Well, it has always been trying to trick us, but this time it's even more aggressive. You can no longer tell Edge from Chrome. Just go ahead and try. Just last week, I wrote about Edge trying to get users to launch it automatically at boot time. Shortly after, I noticed that Chrome was asking for the exact same thing. Today, I clicked on the weather app on my Windows machine, and of course it opened Edge and asked me to set it as the default. I dismissed the popup and noticed that the website was pushed down from the top by another browser message, this one asking to transfer my data from my other browser to Edge. Bring your favorites, passwords, history, cookies and more from other browsers each time you browser in Microsoft Edge. I visited a few other pages and saw a bunch of ads, which reminded me to switch back to Chrome. I did, but I noticed something odd: when I tabbed between the two browsers, I couldn't tell which was which. Can you tell the difference I know they are both built on Chromium, but until fairly recently Edge had a distinct Microsoft look. It seems Microsoft is aggressively pursuing the fight for the front page of the internet. On my mobile device, I use the Outlook app for one of my email accounts. I noticed that when I click a link, instead of opening it directly in my browser, the app asks whether I want to open it with Microsoft Edge. Note that Edge isn't even installed on my device. Microsoft is trying every tactic in the book to get in front of the user. The front page of the internet is still the only race that matters for large tech companies. It doesn't matter whether your product is good or bad; your success largely depends on how many eyes you can get on your app. Google owns prime real estate. It is the default search engine on most desktop browsers. It is the default on all Android devices, with a negligible margin of error. It is the default on all iOS devices, for a cool $20 billion a year. And of course, it owns the largest ad network in the world. If Microsoft owned the front page today, it wouldn't be able to monetize it as well as Google does. It's one thing to own the front page; it's another to consolidate data from every branch of our web activity. For example, if I look up a product on YouTube on my TV, Google can later retarget me with an ad for that product while I'm reading an article on my iPhone. Microsoft has little to no presence on my iPhone. This mesh of front pages is what makes it worthwhile for Google to be the front page on every device. Even OpenAI has started tracking user web activity outside its own website in an effort to better monetize its position. Google continues to win even though its language models don't top the benchmarks and are often beaten by much smaller models. Meanwhile, Microsoft still doesn't have a model to its name, so it is trying to look enough like Google that people won't notice. Google Search and Bing Search play with the same theme. PS: It was a challenge to take screenshots for this post because half the time I didn't know which browser I was using. PS2: Edge makes it so hard to navigate between browsers because it puts each browser tab you open in its own ALT+TAB menu.

26 minutes ago • 1 votes
FLIP Fluid on Flip Dots

[Hardware] Electromechanical Fluid Simulation

4 days ago • 1 votes
Is This A Joke? In The Auth Header? (F5 BIG-IP UnAuth Heap-Overflow to RCE CVE-2026-94127)

Well, well, well, well, well, well, well, well, well, well, well, well, well, well, well. We're back. Sorry. We've been watching the onslaught of vulnerabilities flood the internet. Every man, dog, and their grandmas (apparently?) are now using LLMs to find and reproduce vulnerabilities - it’

5 days ago • 1 votes
The Reason You Prohibit Things

You want less of them. That’s the reason. You may find that it’s too hard to stop people from doing the thing, literally blood, sweat, and tears trying to prosecute people, but that’s a different thing.

5 days ago
📚 BoredReading

You seem to be enjoying this.

Join free to unlock everything.

Create free account

Already have an account? Sign in