๐Ÿ“š Encyclopedia

Programming Languages ยท updated 2026-11-02

umlol, a programming language whose source is a flowchart

esolangflowchartinterpreterparsingunicodejavascriptjsdocconformance-tests

umlol is an esoteric language in which the program is a flowchart drawn in plain text with box-drawing characters (or ASCII). The source is parsed into a graph of shapes joined by arrows, and the graph is what runs. Live playground: https://umlol.jhampton.io/ (repo ~/dev/umlol, vanilla JS). Its design choices are a useful model for any "picture as program" language and for any language meant to have more than one implementation.

 โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
 โ”‚ fib(n) โ”‚
 โ•ฐโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ•ฏ
     โ–ผ
โ•ฑโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฒ         โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
   n < 2   โ”œโ”€โ”€yesโ”€โ”€โ–ถโ”‚ return n โ”‚
โ•ฒโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ•ฑ         โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
     โ”‚ no
     โ–ผ
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ return fib(n โˆ’ 1) + fib(n โˆ’ 2) โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Graph parsing, not grid walking

Two-dimensional esolangs such as Befunge and AsciiDots move an instruction pointer across the character grid, so layout is behavior. umlol instead parses the drawing into nodes and edges once: layout has no meaning, and two drawings with the same shapes, text and connections are the same program. That makes programs readable as diagrams, lets the tool print the graph as JSON (--graph) and trace execution over it (--trace), and makes errors precise (error at ROW:COL: ..., pointing at the misdrawn cell).

Reading a drawing reliably

Language inside the shapes

Process boxes hold statements (x โ† e, print, read), decisions hold one boolean expression, and rounded name(params) terminals start subroutines whose return terminals give back a value. Integers are arbitrary precision (JS BigInt), lists are shared references with deep =, there are no globals, and recursion is allowed. Each diagram is everything reachable from its entry; diagrams may not share shapes.

The spec and the tests are the language

Interpreting without blowing the host stack

The first interpreter ran each call as a nested JavaScript generator (yield* per call level, so a debugger could step it). V8 overflowed its own stack at about 900 nested calls. The fix was a frame-stack machine: each node's text is compiled lazily to a small stack-code array, and execution keeps an explicit stack of frames {node, code, pc, operand stack, environment, caller}. Calls push a frame instead of recursing in JS, and/or short-circuit with jumps, and the depth limit becomes a deliberate number (the spec requires at least 10,000 nested calls, tested; the implementation stops at 100,000 with a runtime error, never a crash). The same lesson applies to any interpreter written in a language with a small native stack: don't map guest recursion onto host recursion.

No build step: vanilla JS with JSDoc types

The code is plain ES modules with // @ts-check and JSDoc types; TypeScript's compiler only type-checks (npm run check), and there is no build step. Two checks run: src/ with no Node or DOM type libraries (proving the core runs in a browser and in Node unchanged), then web/ with DOM types. A recursive JSDoc type needs two steps (Value = ... | List, then List = Array<Value>); writing Value[] inside Value directly fails with TS2456.

Playground editing

The browser playground edits the drawing like grid paper: typing overwrites, Enter moves down like a typewriter, the caret can sit past the end of a line, and shortcuts insert shapes and draw edges (Alt+Shift+arrows; backing up erases). Grid edits are pure functions with their own tests. Keyboard shortcuts use event.code (layout-independent) and avoid Alt+E and Alt+F, which open Chrome's menus on Linux. Every shortcut also exists as a button for touch screens.

Gotchas

See also

Linked from

Sources: umlol repo (SPEC.md, src/, tests/), umlol memory (design canon, status), justinahampton memory experiments-umlol, 2026-10-30..10-31