Loom

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

Posts tagged “phantom-types” (2)

Phantom Types — Making the Compiler See What Isn't ThereMar 23 13.2K

A phantom type parameter exists only in the type system — it carries no data, occupies no memory, and vanishes in the binary. Parametricity guarantees it works. Representation independence makes it free.

--c++20 --type-theory --phantom-types --templates --zero-cost --parametricity
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