Loom

A blog engine that just works. One binary, no setup, no dependencies.

~/  20 posts

The Render Tree Walk — From Layout to CellsMar 13 10.8K

The renderNode function is the most complex piece in the pipeline. It walks the component tree, decides what to re-render and what to skip, and orchestrates the entire frame. I extracted it from minified JavaScript, and the architecture is beautiful.

--c++23 --render-tree --yoga-layout --blit --dirty-flag --component-tree --claude-code
app.use(chaos): Why Middleware Architectures Fall ApartMar 12 7.2K

Your /health endpoint runs through 12 middleware functions to return {ok: true}. Your architecture is doing a pull-up, a squat, and a mile run before it's allowed to say I'm fine.

--architecture --systems --series --performance
The Output Builder — Recording Before RenderingMar 11 10.8K

Claude Code doesn't render directly. It records what it wants to do, then replays the recording. This decoupling is what makes blit, clip, and scroll optimizations possible — and it's the reason 95% of the screen costs zero work per frame.

--c++23 --output-builder --variant --blit-optimization --damage-tracking --claude-code
Your Web Framework Is Lying to YouMar 10 6.0K

Your framework didn't remove complexity. It hid it somewhere you can't find at 3am when everything is on fire.

--feature --architecture --systems --web
Interning Pools — Strings Are Integers NowMar 09 12.0K

The moment you intern a style, comparison becomes integer equality. The moment you cache the transition between two styles, rendering becomes a hash table lookup. This is where Claude Code's renderer goes from fast to unreasonably fast.

--c++23 --interning --style-pool --transition-cache --constexpr --hash-map --claude-code
Cell Packing — Fitting a Universe into 8 BytesMar 07 8.4K

How do you fit a character, a style, a width, and type safety into exactly 8 bytes? Claude Code uses bitfield surgery. We use phantom-tagged IDs and static_assert. Both compile to one cmp instruction.

--c++23 --bit-packing --phantom-types --static-assert --memory-layout --claude-code
The Screen Buffer — A 2D Cell GridMar 05 9.6K

Every terminal UI, no matter how complex, reduces to filling a 2D grid of cells and diffing it against the previous frame. Claude Code uses a dual-view memory trick to make this fast. In C++, we don't need the trick.

--c++23 --terminal-rendering --screen-buffer --memory-layout --simd --claude-code
The Problem — Why Terminals Are BrokenMar 03 7.2K

Two threads. One stdout. Total corruption. This is the bug that sent me reverse-engineering Claude Code's binary — and the fundamental reason every serious TUI needs a rendering engine.

--c++23 --terminal --tui --ansi-escape --race-condition --claude-code
How I Ported Claude Code's Rendering Engine to Modern C++Mar 03 6.0K

I decompiled Claude Code's binary, reverse-engineered its terminal rendering pipeline, and rebuilt the whole thing in C++23. This is the story of what I found inside — and how to build a flicker-free, 60fps terminal UI from scratch.

--c++23 --terminal-rendering --reverse-engineering --tui --claude-code --ansi
constexpr Everything — Real Algorithms Running Inside Your CompilerFeb 23 20.4K

constexpr started as a way to mark simple constants. Then it grew. And grew. Now it's an entire execution engine inside the compiler, running real algorithms with loops, branches, allocations, and exceptions.

--compile-time-cpp --constexpr --consteval --constinit --immediate-functions
Loom vs Hugo vs JekyllFeb 17 8.4K

An honest side-by-side of three blog engines — what each does well, where each falls short, and why they exist.

--comparison --architecture