Loom

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

Posts tagged “memory-layout” (2)

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