F
Feed Atlas
OPML directory + server-side RSS reader

matklad.github.io

SiteRSSBlogs
Back

Latest posts

  • Steering Zig Fmt
    May 08, 2026Alex Kladov

    Steering Zig Fmt May 8, 2026 Two tips on using zig fmt effectively. Read this if you are writing Zig, or if you are implementing a code formatter. For me, zig fmt is better than any other formatter I used: rustfmt, the one in IntelliJ, deno fmt. zig fmt is steerable. For every syntactic construct, it has several variations for how it might be laid out. The variation used is selected by looking at

  • Minimal Viable Zig Error Contexts
    May 03, 2026Alex Kladov

    Minimal Viable Zig Error Contexts May 3, 2026 fn process_file(io: Io, path: []const u8) !void { errdefer log.err("path={s}", .{path}); const fd = try Io.Dir.cwd().openFile(io, path, .{}); defer fd.close(io); // ... } Out of the box, Zig provides minimal and sufficient facilities for error handling — strongly-typed error codes. Error reporting is left to the user. Idiomatic s

  • 256 Lines or Less: Test Case Minimization
    Apr 20, 2026Alex Kladov

    256 Lines or Less: Test Case Minimization Apr 20, 2026 Property Based Testing and fuzzing are a deep and science-intensive topic. There are enough advanced techniques there for a couple of PhDs, a PBT daemon, and a client-server architecture. But I have this weird parlor-trick PBT library, implementable in a couple of hundred lines of code in one sitting. This week I’ve been thinking about a cool

  • Consensus Board Game
    Mar 19, 2026Alex Kladov

    Consensus Board Game Mar 19, 2026 I have an early adulthood trauma from struggling to understand consensus amidst a myriad of poor explanations. I am overcompensating for that by adding my own attempts to the fray. Today, I want to draw a series of pictures which could be helpful. You can see this post as a set of missing illustrations for Notes on Paxos, or, alternatively, you can view that post

  • JJ LSP Follow Up
    Mar 05, 2026Alex Kladov

    JJ LSP Follow Up Mar 5, 2026 In Majjit LSP, I described an idea of implementing Magit style UX for jj once and for all, leveraging LSP protocol. I’ve learned today that the upcoming 3.18 version of LSP has a feature to make this massively less hacky: Text Document Content Request LSP can now provide virtual documents, which aren’t actually materialized on disk. So this: can now be such a virtual

  • Against Query Based Compilers
    Feb 25, 2026Alex Kladov

    Against Query Based Compilers Feb 25, 2026 Query based compilers are all the rage these days, so it feels only appropriate to chart some treacherous shoals in those waters. A query-based compiler is a straightforward application of the idea of incremental computations to, you guessed it, compiling. A compiler is just a simple text transformation program, implemented as a lot of functions. You cou

  • Wrapping Code Comments
    Feb 21, 2026Alex Kladov

    Wrapping Code Comments Feb 21, 2026 I was today years old when I realized that: It’s a good idea to limit line length to about 100 columns. This is a physical limit, the width at which you can still comfortably fit two editors side by side (see Size Matters). Note an apparent contradiction: the optimal width for readable prose is usually taken to be narrower, 60–70 columns. The contradiction is r

  • Diagnostics Factory
    Feb 16, 2026Alex Kladov

    Diagnostics Factory Feb 16, 2026 In Error Codes For Control Flow, I explained that Zig’s strongly-typed error codes solve the “handling” half of error management, leaving “reporting” to the users. Today, I want to describe my personal default approach to the reporting problem, that is, showing the user a useful error message. The approach is best described in the negative: avoid thinking about er

  • Justifying text-wrap: pretty
    Feb 14, 2026Alex Kladov

    Justifying text-wrap: pretty Feb 14, 2026 p { text-wrap: pretty; } Something truly monumental happened in the world of software development in 2025. Safari shipped a reasonable implementation of text-wrap: pretty: https://webkit.org/blog/16547/better-typography-with-text-wrap-pretty/. We are getting closer and closer to the cutting-edge XV-century technology. Beautiful paragraphs! We are not qu

  • Programming Aphorisms
    Feb 11, 2026Alex Kladov

    Programming Aphorisms Feb 11, 2026 A meta programming post — looking at my thought process when coding and trying to pin down what is programming “knowledge”. Turns out, a significant fraction of that is just reducing new problems to a vocabulary of known tricks. This is a personal, descriptive post, not a prescriptive post for you. It starts with a question posted on Ziggit. The background here