Exhibit
SHEET-DOS — an operating system that lives in a spreadsheet
A 118 by 40 text screen. Z-ordered windows, a terminal with real scrollback, a clock with hands, a system monitor and Conway's Game of Life. No macros, no VBA, no add-ins. Every character on that screen is a cell, and every cell is a formula.
- 33,704formulas
- 0macros
- 0lines of VBA
- 4,720cells on screen
Commands are written into fourteen ordinary cells — D48:D61 — and the sheet recalculates. Click any cell on the screen to see the formula behind it.
What is actually running here
Your browser is holding a workbook of 46,352 cells, recalculating it once a second, and painting the result. This is not an emulator running something else: the screen is the sheet. The formula engine written for this page was checked against LibreOffice — all 4,720 characters and all 4,720 colour attributes come out identical.
1 · The screen is a framebuffer
Real text-mode hardware keeps two grids: one holding the character in each screen position, one holding its colour. SHEET-DOS does the same thing. Rows 3 to 42 are the character buffer; rows 103 to 142 are the attribute buffer, exactly one hundred rows below their own cells.
Colour comes from 48 conditional-formatting rules, each reading the attribute cell a hundred rows down: B103=3 is black text on phosphor green, which is to say a focused title bar. Sixteen attributes, three palettes. Typing theme amber adds twenty to every attribute in the buffer and a different set of rules takes over. The characters never move.
2 · Windows are rows in a table
Each window is a row with an x, a y, a width, a height, an open flag and a z-order. Nothing is drawn, grouped or floated. Every screen cell asks one question: of the windows covering me, which is on top? The z-order and the window's slot number are packed into a single key, so one MAX can answer it:
=SUMPRODUCT(MAX(WIN_OPEN*(WIN_X<=B$2)*(WIN_X+WIN_W>B$2)
*(WIN_Y<=$A3)*(WIN_Y+WIN_H>$A3)*WIN_KEY))
MOD that by 100 and you have the owning window. A cell owned by nobody checks the same buffer one row up and one column left — if a window is there, this cell is its drop shadow. That is the whole window manager.
3 · The shell is INDEX and LOOKUP
The command line below the screen is fourteen cells. The kernel splits each one into a verb and an argument, then folds the whole list into state. A window is open if the last command naming it was not close:
=LOOKUP(2,1/((CMD_ARG=$B5)*((CMD_VERB="open")+(CMD_VERB="close")
+(CMD_VERB="focus"))),CMD_VERB)
LOOKUP(2,1/condition) is the old trick for finding the last match in a list. Here it doubles as z-order: the line number of the most recent open becomes the window's z, so opening something raises it above everything else.
4 · And the applications
- Terminal — real scrollback. Each command contributes a prompt line plus however many lines its output needs; a running total turns a screen row into a command and a line offset.
- Chronometer — the hands are drawn with geometry. Each cell knows its own offset from the centre in pixels and tests whether it falls inside the width and length of a hand pointing at
NOW(). A cell's aspect ratio, 7.41 by 17.01, is corrected for in the formula, or the dial would be an egg. - Life — generation 1 is data. Generations 2 to 30 are twelve thousand formulas, each summing the nine cells above it in the previous generation.
- System monitor — the telemetry is synthetic, a sum of sines over the clock. The graph drawing it is not.
- Calculator — parses the text you typed, finds the operator, and shows the answer in four bases.
Why any of this matters
None of this is a good way to build an operating system. That is the point. A spreadsheet is a general-purpose reactive runtime that sixty million people already have open. Whoever can think in it — break a process into state, rules and dependencies — builds things nobody intended to be possible. The tool was never the constraint.