mujun.xyz

Technical knowledge, preserved.

Volume I · A reading library
I.

On First Principles

Why we begin with what cannot be reduced further.

Every tutorial in this library begins with the same question: what is the smallest part that still works? Reduce a system until it breaks, then back up one step. That is the unit you teach.

The technical web is full of confident strangers explaining concepts they themselves do not understand — and getting away with it because the reader is even more lost than the writer. This library refuses that contract. Each tutorial here is written from a point of real understanding, in the hand of someone who has used the thing for years and watched it fail in production at three in the morning.

We assume the reader is patient, intelligent, and slowing down on purpose. There is no scroll-jacking, no tracker, no popup, no autoplay. Just the page, the words, and the ink.

Reading is the act of constructing a model in your head. Tutorials succeed or fail based on whether the model the reader builds matches the model the writer intended. Diagrams help; brevity helps more; honesty about what you do not know helps most.

II.

A Small Example

An idempotent shell pipeline, as a study in restraint.

Consider this shell snippet. It deduplicates lines from a stream and counts occurrences, then sorts the result by frequency. It is two pipes, three commands, and one flag. Nothing more.

A small unix pipeline
sort lines.txt \
  | uniq -c \
  | sort -rn

The lesson is not in what the pipeline does — you can read the man pages for that. The lesson is what it refuses to do. It does not log. It does not retry. It does not mask its own failures. If lines.txt is missing, you get an error and a non-zero exit. If a process fails, the pipe carries that signal forward. Each command is a single, small, well-named tool.

Write programs that do one thing and do it well. Write programs to work together. — Doug McIlroy

Now compare to a Python equivalent. Same behavior, twice the lines, and three more places to introduce a subtle bug:

The same task, in Python
from collections import Counter
from pathlib import Path

lines = Path("lines.txt").read_text().splitlines()
counts = Counter(lines)
for line, n in counts.most_common():
    print(f"{n:>7} {line}")

This is not an argument that shell is better than Python. It is an argument that each tool has a vocabulary, and the right tool is usually the one whose vocabulary fits the problem with the least bending. Knowing this is the work of a decade.

III.

Reading Order

Volumes that have been pressed and bound, with more in preparation.

  1. 01

    On First Principles

    Essay · 4 pp. · pressed

    Why every tutorial in this library begins with the smallest unit that still works.

  2. 02

    A Small Example

    Tutorial · 3 pp. · pressed

    An idempotent shell pipeline, as a study in restraint.

  3. 03

    Errors and What They Mean

    Essay · in preparation

    An error is not a failure of the system. An error is a message from the system to you, written in a hurry. Learning to read these messages is most of debugging.

  4. 04

    On Caching

    Tutorial · in preparation

    Two hard problems. The other one is naming things. The third is off-by-one errors.

  5. 05

    A Letter to the Reader

    Colophon · in preparation

    On who this library is for, and on the reading habits we hope it cultivates.

IV.

Colophon

A note on the materials and methods of this volume.

Display type
Lora, set as a transitional serif at clamp(2.0rem, 5vw, 4.2rem)
Body type
Lora, 18 px, weight 400, line-height 1.7
Code type
IBM Plex Mono, 0.95 rem, weight 400
Inks
Forest Deep #2D5016, Forest Mid #3A6B1F, Forest Light #4A8C2A
Papers
Paper Bright #F5F1EB, Paper Warm #D4C4B0
Section angle
+17°, the angle of a spear at rest
Tracking
None. No analytics, no cookies, no third-party scripts.
Volume
I · First impression · 2026

Footnotes

[1] The Python version reads the entire file into memory; the shell version streams it. For a billion-line input, this matters more than the line count.