Raph Levien's JIT trick renders bitmap text on microcontrollers in 3 cycles per glyph

JIT bitmap text rendering for microcontrollers

Raph Levien's JIT trick renders bitmap text on microcontrollers in 3 cycles per glyph

Raph Levien needed fast text rendering for vic-2350, his RP2350-based reimagining of an 80s home computer. Racing the beam leaves only ~6 cycles per pixel, and Rust couldn't meet that, so he wrote the renderer in ARM assembly via his symbolasm language. The key trick: a JIT compiles each string into optimized code that packs glyphs from a tightly packed font bitmap into a 1-bit buffer, then expands it to RGB565 at 1.75 cycles per pixel. Clever packing even overlaps glyphs—l is the left side of U—shrinking the font from 1140 to 960 bytes.

Any glyph contained within another glyph doesn't need to be packed separately. There are a few examples, some surprising. For example, l is the left side of U, and 0 is identical to () with the space between them removed.

More from this day

2026-11-08