Written 2026-10-06

the rainbows logo, inspired by the cover art for In Rainbows

rainbows is a specification for devices connected to the ok virtual machine, named after Radiohead's album In Rainbows. ok itself only provides instruction evaluation and the "data" and "return" stacks for basic computation, but if you wanted to output something to a screen or a console, or receive input from a mouse or keyboard, you'd have to "map" those devices into memory.

Memory Mapping

ok calls ok_mem_read(addr) whenever it needs to read a byte from RAM, and ok_mem_write(addr) whenever it needs to write a byte to RAM. These are functions that you define yourself, in order to make user-defined memory-mapping possible. For example, with no memory-mapping, your definition of ok_mem_read might look like this: