# Matklad

Published articles for Matklad.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Avoid Public Functions Calling Other Public Functions

DevFeed: [Avoid Public Functions Calling Other Public Functions](<https://devfeed.tech/articles/avoid-public-functions-calling-other-public-functions-107178.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/10/29/pub-calls-pub.html>)

Author: Alex Kladov

Published: 2026-10-29T00:00:00Z

Content type: opinion

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [modules](<https://devfeed.tech/topics/modules.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [abstraction](<https://devfeed.tech/tags/abstraction.md>), [api](<https://devfeed.tech/tags/api.md>), [apis](<https://devfeed.tech/tags/apis.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [code-sharing](<https://devfeed.tech/tags/code-sharing.md>), [dry](<https://devfeed.tech/tags/dry.md>), [function](<https://devfeed.tech/tags/function.md>), [functionality](<https://devfeed.tech/tags/functionality.md>), [functions](<https://devfeed.tech/tags/functions.md>), [guidelines](<https://devfeed.tech/tags/guidelines.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [interface](<https://devfeed.tech/tags/interface.md>), [io](<https://devfeed.tech/tags/io.md>), [isolation](<https://devfeed.tech/tags/isolation.md>), [library](<https://devfeed.tech/tags/library.md>), [mock](<https://devfeed.tech/tags/mock.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [module](<https://devfeed.tech/tags/module.md>), [optional](<https://devfeed.tech/tags/optional.md>), [public](<https://devfeed.tech/tags/public.md>)

### AI overview

When two public functions share implementation, have both call a private helper instead of having one call the other. A public API should suit its callers; reusing a public function internally can create pressure to add parameters that outside users should not set, degrading the interface over time. Changes to a private helper's signature remain local. The exception is a shortcut API intentionally defined as a chain of public calls, where the author says to avoid private calls. The author also argues against mocking methods and testing them in isolation, favoring mocks of I/O and tests of software functionality, and says guidelines should be followed for their reasoning rather than authority. No concrete example is provided.

### Source excerpt

A small-scale rule of thumb. This article will land much better with a concrete example, but I am drawing a blank here, so you gotta just blindly trust my say so!

## On Git Refs

DevFeed: [On Git Refs](<https://devfeed.tech/articles/on-git-refs-66903.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/10/07/git-ref.html>)

Author: Alex Kladov

Published: 2026-10-07T00:00:00Z

Content type: tutorial

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [Git](<https://devfeed.tech/topics/git.md>), [content addressed store](<https://devfeed.tech/topics/content-addressed-store.md>)

Tags: [commands](<https://devfeed.tech/tags/commands.md>), [git](<https://devfeed.tech/tags/git.md>), [git-commands](<https://devfeed.tech/tags/git-commands.md>), [refs](<https://devfeed.tech/tags/refs.md>)

### AI overview

The article explains Git refs as mutable key-value mappings to content-addressed objects. It uses fetch and branch examples to clarify remote-tracking refs, local branches, and how Git records remote state between explicit synchronization points.

### Source excerpt

I have recently improved my mental model of Git. Consider these two git commands:

## Benchmark In Milliseconds

DevFeed: [Benchmark In Milliseconds](<https://devfeed.tech/articles/benchmark-in-milliseconds-65088.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/10/05/benchmark-milliseconds.html>)

Author: Alex Kladov

Published: 2026-10-05T00:00:00Z

Content type: article

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [benchmarking](<https://devfeed.tech/tags/benchmarking.md>), [intuition](<https://devfeed.tech/tags/intuition.md>), [measurement](<https://devfeed.tech/tags/measurement.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [performance](<https://devfeed.tech/tags/performance.md>), [speed](<https://devfeed.tech/tags/speed.md>)

### AI overview

The author recommends tuning a microbenchmark to run for about 300 milliseconds. This duration makes results easy to read, reduces the influence of fixed overheads, lets developers use human timing intuition, and keeps repeated runs quick enough to inspect variation. The author frames benchmarking as a way to build intuition for decisions, rather than solely to obtain precise performance measurements.

### Source excerpt

How long should a micro benchmark run? My rule of thumb is to tweak the input size until the benchmark takes about 300ms, for the following reasons:

## Using Generative Testing and Oracles to Find Bugs in Regular Expression Algorithms

DevFeed: [Using Generative Testing and Oracles to Find Bugs in Regular Expression Algorithms](<https://devfeed.tech/articles/finding-bugs-55444.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/09/19/finding-bugs.html>)

Author: Alex Kladov

Published: 2026-09-19T00:00:00Z

Content type: opinion

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [computational complexity](<https://devfeed.tech/topics/computational-complexity.md>), [Regular expression](<https://devfeed.tech/topics/regular-expression.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [extra](<https://devfeed.tech/tags/extra.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

The article examines whether generative testing is more effective than example-based unit tests for finding bugs. It presents fuzzing a regular expression implementation and emphasizes comparing algorithm results with a known correct answer, or oracle.

### Source excerpt

Are generative (randomized) tests significantly more effective than example-based unit-tests at discovering bugs? There's an interesting discussion about this on lobste.rs. One argument in favor of unit tests is, paraphrasing

## Static Allocation, Constant Work

DevFeed: [Static Allocation, Constant Work](<https://devfeed.tech/articles/static-allocation-constant-work-45147.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/09/02/static-allocation-constant-work.html>)

Author: Alex Kladov

Published: 2026-09-02T00:00:00Z

Content type: article

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [Memory Safety](<https://devfeed.tech/topics/memory-safety.md>), [C](<https://devfeed.tech/topics/c.md>), [Memory safety verification](<https://devfeed.tech/topics/memory-safety-verification.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [c](<https://devfeed.tech/tags/c.md>), [code](<https://devfeed.tech/tags/code.md>), [error](<https://devfeed.tech/tags/error.md>), [hardening](<https://devfeed.tech/tags/hardening.md>), [memory-safety](<https://devfeed.tech/tags/memory-safety.md>)

### AI overview

The article discusses memory-safety risks from use-after-free and type confusion, then considers typed allocators, type-segregated object pools, enum-related edge cases, and static allocation as hardening techniques. The supplied excerpt is incomplete.

### Source excerpt

In reply to this email:

## Cancelation Terminology

DevFeed: [Cancelation Terminology](<https://devfeed.tech/articles/cancelation-terminology-45146.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/08/31/cancelation-terminology.html>)

Author: Alex Kladov

Published: 2026-08-31T00:00:00Z

Content type: article

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [Error Handling](<https://devfeed.tech/topics/error-handling.md>), [Protocol (disambiguation)](<https://devfeed.tech/topics/protocol.md>), [cpu](<https://devfeed.tech/topics/cpu.md>), [Kernel](<https://devfeed.tech/topics/kernel.md>), [interface](<https://devfeed.tech/topics/interface.md>)

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [graceful-shutdown](<https://devfeed.tech/tags/graceful-shutdown.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [protocol](<https://devfeed.tech/tags/protocol.md>)

### AI overview

This short technical note distinguishes synchronous cancellation, asynchronous cancellation, and graceful shutdown. It explains how synchronous cancellation unwinds control flow, while asynchronous cancellation uses a communication protocol that lets ongoing work acknowledge the request and clean up safely.

### Source excerpt

A short note explaining the difference between synchronous cancelation, asynchronous cancelation, and graceful shutdown. I am not too attached to these specific three terms, but I want to call your attention to the three things behind them, which are important not to confuse with each other.

## Rust Glancer

DevFeed: [Rust Glancer](<https://devfeed.tech/articles/rust-glancer-45145.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/08/21/rust-glancer.html>)

Author: Alex Kladov

Published: 2026-08-21T00:00:00Z

Content type: opinion

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [Rust](<https://devfeed.tech/topics/rust.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [ide](<https://devfeed.tech/topics/ide.md>), [Parser](<https://devfeed.tech/topics/parser.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [JSON Feed](<https://devfeed.tech/topics/json-feed.md>)

Tags: [client](<https://devfeed.tech/tags/client.md>), [ide](<https://devfeed.tech/tags/ide.md>), [json](<https://devfeed.tech/tags/json.md>), [json-parsing](<https://devfeed.tech/tags/json-parsing.md>), [parsing](<https://devfeed.tech/tags/parsing.md>), [process](<https://devfeed.tech/tags/process.md>), [programming](<https://devfeed.tech/tags/programming.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [rust](<https://devfeed.tech/tags/rust.md>)

### AI overview

An informal commentary on Rust Glancer, a functional Rust language server that reportedly uses much less RAM. It discusses incremental parsing, AST design, lazy analysis, proc macros, JSON parsing overhead, plugin-based handling of metaprogramming, and data synchronization between language clients and servers.

### Source excerpt

Rust Glancer, a functional LSP server for Rust which uses two orders of magnitude less RAM, is incredibly cool. Go check it out! This post started as a comment on lobste.rs, but I figured it out that it's better to publish it somewhat more prominently. Don't expect polished writing though!

## Standard Library Design Depends on Quality and Organizational Capacity

DevFeed: [Standard Library Design Depends on Quality and Organizational Capacity](<https://devfeed.tech/articles/better-batteries-45144.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/08/20/better-batteries.html>)

Author: Alex Kladov

Published: 2026-08-20T00:00:00Z

Content type: opinion

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [Rust](<https://devfeed.tech/topics/rust.md>)

Tags: [programming](<https://devfeed.tech/tags/programming.md>), [standard](<https://devfeed.tech/tags/standard.md>), [standard-library](<https://devfeed.tech/tags/standard-library.md>)

### AI overview

The article argues that the key distinction between minimal and comprehensive standard libraries is not size but quality. It compares Python, Go, and Rust, linking their standard-library strengths and gaps to API design and the organizational capacity to maintain and extend them.

### Source excerpt

One of the eternal schisms in programming is over the question of whether the standard library should be minimal or encompassing. This is the wrong question to ask. The right one is:

## Printing Lists

DevFeed: [Printing Lists](<https://devfeed.tech/articles/printing-lists-45143.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/08/14/printing-lists.html>)

Author: Alex Kladov

Published: 2026-08-14T00:00:00Z

Content type: tutorial

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [pretty printing](<https://devfeed.tech/topics/pretty-printing.md>)

Tags: [list](<https://devfeed.tech/tags/list.md>), [printing](<https://devfeed.tech/tags/printing.md>)

### AI overview

The document describes a concise idiom for printing comma-separated lists: print a comma before an element when needed.

### Source excerpt

To print a comma-separated list, a concise idiom is to optionally print the comma first, before the element:

## Zig's Io.Threaded is Neat

DevFeed: [Zig's Io.Threaded is Neat](<https://devfeed.tech/articles/zig-s-io-threaded-is-neat-45142.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/08/06/neat-io-threaded.html>)

Author: Alex Kladov

Published: 2026-08-06T00:00:00Z

Content type: article

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [Zig](<https://devfeed.tech/topics/zig.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [interface](<https://devfeed.tech/topics/interface.md>), [Parallelism](<https://devfeed.tech/topics/parallelism.md>), [POSIX](<https://devfeed.tech/topics/posix.md>), [Kernel](<https://devfeed.tech/topics/kernel.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>), [io\_uring](<https://devfeed.tech/topics/io-uring.md>)

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [blocking](<https://devfeed.tech/tags/blocking.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [interface](<https://devfeed.tech/tags/interface.md>), [io-interface](<https://devfeed.tech/tags/io-interface.md>), [io-uring](<https://devfeed.tech/tags/io-uring.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [posix](<https://devfeed.tech/tags/posix.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [threads](<https://devfeed.tech/tags/threads.md>), [zig](<https://devfeed.tech/tags/zig.md>)

### AI overview

The article examines Zig's std.Io.Threaded implementation, which uses standard OS threads and blocking system calls while supporting reliable cancellation. It contrasts concurrency with parallelism and discusses the difficulty of canceling work blocked inside kernel syscalls.

### Source excerpt

std.Io.Threaded is one of the implementations of Zig's new Io interface that enables concurrency. This is a boring just use threads impl. I personally find it neat though --- it does this weird thing that I wanted to do for ages, that to my knowledge no one else is doing properly, and implements it better than I thought to be possible.

## Memory Safety's Hardest Problem

DevFeed: [Memory Safety's Hardest Problem](<https://devfeed.tech/articles/memory-safety-s-hardest-problem-45141.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/07/20/memory-safety-hardest-problem.html>)

Author: Alex Kladov

Published: 2026-07-20T00:00:00Z

Content type: opinion

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [Memory Safety](<https://devfeed.tech/topics/memory-safety.md>), [Ada](<https://devfeed.tech/topics/ada.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Software](<https://devfeed.tech/topics/software.md>)

Tags: [buffer-overflow](<https://devfeed.tech/tags/buffer-overflow.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [memory-safety](<https://devfeed.tech/tags/memory-safety.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

The article examines a difficult memory-safety case involving a tagged union, a pointer to its internals, and subsequent type confusion after the union is overwritten. It notes that buffer overflows are highly exploitable and can be addressed with compiler-inserted bounds checks, while questioning the practical impact of the more difficult example.

### Source excerpt

Uplifting a lobsters comment for easier reference.

## CSS: Unavoidable Bad Parts

DevFeed: [CSS: Unavoidable Bad Parts](<https://devfeed.tech/articles/css-unavoidable-bad-parts-45140.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/06/04/css-unavoidable-bad-parts.html>)

Author: Alex Kladov

Published: 2026-06-04T00:00:00Z

Content type: tutorial

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [CSS](<https://devfeed.tech/topics/css.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [Web](<https://devfeed.tech/topics/web.md>), [HTML](<https://devfeed.tech/topics/html.md>), [Web APIs](<https://devfeed.tech/topics/web-apis.md>)

Tags: [css](<https://devfeed.tech/tags/css.md>), [html](<https://devfeed.tech/tags/html.md>), [html5](<https://devfeed.tech/tags/html5.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [web-developers](<https://devfeed.tech/tags/web-developers.md>)

### AI overview

An informal CSS tutorial for people who need to style web pages without being professional web developers. It presents a learnable subset of modern web technologies and discusses semantic HTML, wrappers, and the difficulty of layout.

### Source excerpt

An ersatz CSS tutorial for people who need to style a web page, but aren't web developers. I am a wrong person to write this kind of thing, as I have neither the time, nor experience. I'd much rather read a book about this. Alas, I had to learn all this stuff from trawling MDN, so perhaps it is valuable to document what I have so far.

## TIL: Symlinking NixOS Dotfiles

DevFeed: [TIL: Symlinking NixOS Dotfiles](<https://devfeed.tech/articles/til-symlinking-nixos-dotfiles-45139.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/05/21/symlinking-nixos-dotfiles.html>)

Author: Alex Kladov

Published: 2026-05-21T00:00:00Z

Content type: tutorial

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [dotfiles](<https://devfeed.tech/topics/dotfiles.md>), [NixOS](<https://devfeed.tech/topics/nixos.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Nix](<https://devfeed.tech/topics/nix.md>), [systemd](<https://devfeed.tech/topics/systemd.md>), [Repository](<https://devfeed.tech/topics/repository.md>), [systems](<https://devfeed.tech/topics/systems.md>)

Tags: [config](<https://devfeed.tech/tags/config.md>), [declarative](<https://devfeed.tech/tags/declarative.md>), [dependency-management](<https://devfeed.tech/tags/dependency-management.md>), [emacs](<https://devfeed.tech/tags/emacs.md>), [nix](<https://devfeed.tech/tags/nix.md>), [nixos](<https://devfeed.tech/tags/nixos.md>), [repository](<https://devfeed.tech/tags/repository.md>), [systemd](<https://devfeed.tech/tags/systemd.md>), [systems](<https://devfeed.tech/tags/systems.md>), [til](<https://devfeed.tech/tags/til.md>)

### AI overview

A practical note on managing NixOS dotfiles without home-manager. It describes keeping dotfiles in the same repository as the system configuration and using systemd-tmpfiles, configured through NixOS, to create the required symlinks declaratively.

### Source excerpt

The standard answer to managing dotfiles on NixOS is home-manager. I've never used it, due to two aesthetic and one practical objection:

## A Practical Method for Understanding Code and Its Evolution

DevFeed: [A Practical Method for Understanding Code and Its Evolution](<https://devfeed.tech/articles/always-be-blaming-45138.md>)

Original publisher: [Read original article](<https://matklad.github.io/2026/05/18/always-be-blaming.html>)

Author: Alex Kladov

Published: 2026-05-18T00:00:00Z

Content type: opinion

Language: en

Sources: [Matklad](<https://devfeed.tech/sources/matklad.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [bug](<https://devfeed.tech/topics/bug.md>), [file](<https://devfeed.tech/topics/file.md>), [hashing](<https://devfeed.tech/topics/hashing.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [code](<https://devfeed.tech/tags/code.md>), [file](<https://devfeed.tech/tags/file.md>), [hash](<https://devfeed.tech/tags/hash.md>), [tips](<https://devfeed.tech/tags/tips.md>), [understand](<https://devfeed.tech/tags/understand.md>)

### AI overview

The article presents a method for understanding code by comparing it with an expected solution, tracing how it evolved, and reconstructing the original author's reasoning. It also offers practical advice for documenting code and examining its history.

### Source excerpt

A few tips on 4D-ing your code comprehension skills.