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
In this post I argue that integration-vs-unit is a confused, and harmful, distinction. I provide a more useful two-dimensional mental model instead. The model is descriptive (it allows to think more clearly about any test), but I also include my personal prescriptions (the model shows metrics which are and aren't worth optimizing).| matklad.github.io
If you maintain an open-source project in the range of 10k-200k lines of code, I strongly encourage you to add an ARCHITECTURE document next to README and CONTRIBUTING. Before going into the details of why and how, I want to emphasize that this is not another docs are good, write more docs advice. I am pretty sloppy about documentation, and, e.g., I often use just simplify as a commit message. Nonetheless, I feel strongly about the issue, even to the point of pestering you :-)| matklad.github.io
Matklad's Arts&Crafts| matklad.github.io
Matklad's Arts&Crafts| matklad.github.io
I like the idea of RSS, but none of the RSS readers stuck with me, until I implemented one of my own, using a somewhat unusual technique. There's at least one other person using this approach now, so let's write this down.| matklad.github.io
Matklad's Arts&Crafts| matklad.github.io
This post is a case study of writing a Rust application using only minimal, artificially constrained API (eg, no dynamic memory allocation). It assumes a fair bit of familiarity with the language.| matklad.github.io
This post will be a bit all over the place. Several months ago, I wrote Hard Mode Rust, exploring an allocation-conscious style of programming. In the ensuing discussion, @jamii name-dropped TigerBeetle, a reliable, distributed, fast, and small database written in Zig in a similar style, and, well, I now find myself writing Zig full-time, after more than seven years of Rust. This post is a hand-wavy answer to the why? question. It is emphatically not a balanced and thorough comparison of the ...| 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
This short example is worth pondering a bit if you are learning Zig:| 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