One of my biggest mid-career shifts in how I write code was internalizing the idea from this post: Don't Write Bugs| matklad
Non-technical armchair economics post, where I explain my pet theory for why everything on and outside of the internet is absolutely infested with ads.| matklad
If you have a blog, consider adding a links page to it, which references resources that you find notable: https://matklad.github.io/links.html| matklad.github.io
Matklad's Arts&Crafts| matklad.github.io
An out-there suggestion for the nascent jj ecosystem!| matklad.github.io
I wrote a small tool for myself as my biannual routine check of where llms are currently at. I think I've learned a bunch from this exercise. This is frustrating! I don't want to learn by trial and error, I'd rather read someone's blog post with lessons learned. Sadly, most of the writing on the topic that percolates to me tends to be high-level --- easy to nod along while reading, but hard to extract actionable lessons. So this is what I want to do here, list specific tricks learned.| matklad.github.io
A post about writing a retry loop. Not a smart post about avoiding thundering heards and resonance. A simpleton kind of post about wrangling ifs and fors together to minimize bugs.| matklad.github.io
Some time ago I lamented that I don't know how to write a retry loop such that:| matklad.github.io
A short note about some unexpected usages of Zig's defer statement.| matklad.github.io
A short post about a coding pattern that is relevant for people who use the heap liberally and manage memory with their own hands.| matklad.github.io
Es el disco de Odín. Tiene un solo lado. En la tierra no hay otra cosa que tenga un solo lado.| matklad.github.io
People complain about Rust syntax. I think that most of the time when people think they have an issue with Rust's syntax, they actually object to Rust's semantics. In this slightly whimsical post, I'll try to disentangle the two.| matklad.github.io
It's a bit of a silly post, because syntax is the least interesting detail about the language, but, still, I can't stop thinking how Zig gets this detail just right for the class of curly-braced languages, and, well, now you'll have to think about that too.| matklad.github.io
A short post about a neat little Zig idiom. Consider your average {sum type, variant, tagged union, enum, alt}:| matklad.github.io
In this article, I will describe a recent addition to CSS, the font-size-adjust property. I am also making a bold claim that everyone in the world misunderstands the usefulness of this property, including Google, MDN, and CSS Specification itself. (Just to clarify, no, I am not a web designer and I have no idea what I am talking about).| matklad.github.io
|AC|<|AB|+|BC| is one of the most hardworking inequalities in mathematics. It illustrates an obvious fact --- the fastest way to go from point A to point C is to go directly, without detours:| matklad.github.io
We talk about programming like it is about writing code, but the code ends up being less important than the architecture, and the architecture ends up being less important than social issues.| matklad.github.io
I love profiling! There's a whole lot of different profiling tools available, and they provide a treasure trove of information. If you roughly know the slow area of the code, it's usually not a problem to understand why it is slow. What I have trouble with though, is quickly identifying the rough point of interest. Today I am pretty good at trisecting performance issues, and, if I make it a mission to identify the bottleneck, I usually manage to do it in a couple of hours. However, I don't kn...| matklad.github.io
In this post, I want to highlight one aspect of Go-style minimal version selection that I have missed completely at first. Maybe you missed it too?| matklad.github.io
A popular genre of articles for the past few year has been a SemVer Critique, pointing out various things that are wrong with SemVer itself, or with the way SemVer is being applied, and, customarily, suggesting an alternative versioning scheme. Usually, the focus is either on how SemVer ought to be used, by library authors (nitpicking the definition of a breaking change), or on how SemVer is (not) useful for a library consumer (nitpicking the definition of a breaking change).| matklad.github.io
Canonical source code for software should include checksums of the content of all its dependencies.| matklad.github.io
There's a fascinating Rust library, loom, which can be used to thoroughly test lock-free data structures. I always wanted to learn how it works. I still do! But recently I accidentally implemented a small toy which, I think, contains some of the loom's ideas, and it seems worthwhile to write about that. The goal here isn't to teach you what you should be using in practice (if you need that, go read loom's docs), but rather to derive a couple of neat ideas from first principles.| matklad.github.io
After working on the initial stages of several largish projects, I accumulated a list of things that share the following three properties:| matklad.github.io
This is going to be related to software engineering, pinky promise!| matklad.github.io
Rule of thumb: the size of build or CI configuration should be mostly independent of the project size. In other words, adding, say, a new test should not require adding a new line to the build file to build the test, and a new line to .yml to run it on CI.| matklad.github.io
Welcome to my article about Pratt parsing --- the monad tutorial of syntactic analysis. The number of Pratt parsing articles is so large that there exists a survey post :)| matklad.github.io
Alternative titles: Unit Tests are a Scam Test Features, Not Code Data Driven Integrated Tests| matklad.github.io