Flow in the browser
118 Flow examples compiled to WebAssembly and running
live on this page. Each one is the unedited source from the repository, put
through Flow → C → emcc. Graphics programs link
runtime/gfx_wasm.c, a canvas backend for the same gfx API that
drives the native window and the headless GIF recorder, so nothing in the
games or the field simulations had to change.
Click Run, then click inside the frame so it takes the
keyboard. Esc closes the frame.
Games
23 of 23 running
The same sources docs/demos/games.md records as GIFs, running live on the gfx canvas backend.
2048
2048 in an actual native window (FLOW gfx backend)
Asteroids
ASTEROIDS - Complete Implementation
Breakout
BREAKOUT - Complete Implementation
Checkers
CHECKERS - two-player hotseat
Chetris
Chetris: Chess + Tetris Hybrid (Graphical Version)
Connect Four
CONNECT FOUR vs AI
Flappy
FLAPPY - Complete Implementation
Frogger
FROGGER - Complete Implementation
Jumper
JUMPER - doodle-jump style vertical platformer
Lane Racer
LANE RACER - top-down 4-lane racing game
Lights Out
LIGHTS OUT - Complete Implementation
Match-3
MATCH-3 - Complete Implementation
Maze Chase
MAZE CHASE - Pac-Man style maze game
Minesweeper
MINESWEEPER - Complete Implementation
Missile Command
MISSILE COMMAND - Complete Implementation
Othello
OTHELLO / REVERSI vs AI
Pong
PONG - Complete Implementation
Simon
SIMON - memory game
Snake
SNAKE - Complete Implementation
Sokoban
SOKOBAN - Complete Implementation
Space Invaders
SPACE INVADERS - Complete Implementation
Tetris
TETRIS - Complete Implementation
Tower of Hanoi
TOWER OF HANOI - classic disk puzzle
Morphogenesis
20 of 20 running
Reaction-diffusion, growth and cellular automata fields. Number keys switch presets, R reseeds, P pauses.
Belousov
spiral waves in an excitable medium
Branching Vessels
leaf venation by space colonization
Cahn Hilliard
phase separation and spinodal decomposition
Cell Sorting
differential adhesion, and tissue layers that sort
Coral Ballistic
ballistic deposition and the shadowing instability
Cyclic CA
spirals out of pure noise
DLA
growth where the shape is the history
Eden Growth
a compact cluster with a rough surface, and the roughness
Gray Scott
the canonical morphogenesis model
Heat Morph
anisotropic diffusion sculpting a shape out of noise
Hexagonal CA
snow crystal growth on a triangular lattice
L-System Plant
a stochastic rewriting grammar, drawn as it grows
L-System Tree
a three-dimensional branching grammar, projected and
Life Variants
three outer-totalistic rules on the same soup
Slime Mold
Physarum agents building a transport network
Somite Clock
segmentation by a clock and a wavefront
Swift Hohenberg
rolls and hexagons from a wavelength-selecting operator
Turing Spots
the activator-inhibitor system behind animal coats
Turing Stripes
the same activator-inhibitor system, one parameter away
WFC Growth
structure appearing by constraint propagation
Basics
22 of 22 running
Pure computation. No graphics, no host services: the program runs and prints into the page.
Bubble Sort
Bubble Sort - FLOW version of C++ bubble sort
Declarative Sort
Declarative ordering (Phase 1)
Factorial
Factorial - FLOW version of C++ factorial example
GCD
Greatest Common Divisor - FLOW version of C++ Euclidean algorithm
Hello WASM
Minimal Flow program for the WASM path (Flow → C → emcc)
Hello World
Hello World in FLOW
Loops
Loop examples in FLOW
Match Enums
Basics: match on a simple enum
Palindrome
Palindrome Checker - FLOW version of C++ string palindrome
Pipeline Choose
Pipeline `choose` — a state-driven stage that picks which pipeline runs
Pipeline Fork
Pipeline fork block — apply several pipelines to one value, collect a record
Pipeline Fork Inferred
Anonymous fork block — the record type is inferred, no struct declaration
Pipeline Placeholder
Pipeline placeholder `_` — route the piped value to any argument slot
Power
Power Function - FLOW version of C++ pow() function
Prime Numbers
Prime Numbers - FLOW version of C++ prime number checker
Result Pipeline
Result pipeline — chain fallible steps with stdlib Result helpers
Simple Search
Simple Search - FLOW version
Spans
Spans: a borrowed view over contiguous storage
Type Safety Demo
Advanced Type Safety with Type Aliases and Distinct Types
Language and compilers
22 of 23 running
Generics, traits, enums, effect rows, and Flow tools written in Flow. Output goes to the page.
Async Effects
Async / Timeout / Retry as Policy Effects
Calculator
Expression Calculator
Claim Address Demo
Claim Coordinates demo — Flow port of src/flow/claim_address.py
Closures Demo
Closures/Lambda Demo
Composition Car Engine
Composition Example: Car has-an Engine
Composition Team Employee
Composition Example: Team has Employees
Dependency Injection
Dependency Injection via Effects
Effect Rows
Effect-row Phase 2: declare effects on the signature with `with E`
Enum Match Exhaustive
Enum/ADT match demo - exercises path/const patterns and exhaustiveness
Enums Demo
Enums / Algebraic Data Types Demo
Flow Identifier Lexer
Flow identifier / keyword lexer (self-hosting seed)
Flow Lexer
Flow lexer Phase 2 (self-hosting) — historical seed demo
Generics Demo
Generics Demo
Know Demo
know + fingerprint dogfood
LSP Ordering Port
Flow port of src/flow/lsp_ordering.py — ordering IntelliSense strings
Math Prose Demo
math_prose + proof_sub dogfood demo
OOP Counter
OOP-style Example: Counter with encapsulated state
OOP Person
OOP-style Example: Person with "method" function
Option Result Demo
Option and Result Types Demo
Showcase
Effect System Showcase: One Service, Many Worlds
State Effects
State Effects: Policy Effects with Explicitly-Threaded State
Traits Demo
Demonstrates trait-based polymorphism
Async Primitives
Async primitives (effects-based) — minimal runnable slice
does not build: emcc: undefined symbol flow_fiber_run_main
Numerics and dynamics
16 of 18 running
Solvers, optimisers, linear algebra and control theory. The ones that reach a native BLAS do not link here.
Controllability Demo
Controllability + similarity transform on mass-spring-damper
GA + WFC Coupled
GA + WFC coupled pipeline via dsys syntax
GA Control
GA search for stabilizing feedback on discrete double integrator
GA Dsys (namespaced)
Same GA + sense pipeline as ga_dsys_syntax.flow, using the dynamics namespace
GA Dsys Syntax
GA + control analysis via the dsys surface syntax
GA Full Analysis
GA control search + unified dynamical systems analysis
Gramian Demo
Finite vs infinite horizon controllability Gramian
LU Decomposition (pedagogical)
LU Decomposition (pedagogical) — hand-written Doolittle / pivoted LU
Lorenz Attractor
Lorenz attractor integration + Lyapunov separation proxy
Matrix Ops
Basic Matrix Operations
Natural Physics
Natural Physics in Flow
Natural Syntax Demo
Natural Physics Syntax Demo
ODE Solver
Ordinary Differential Equation Solvers
Optimization
Numerical Optimization
Regression (GD)
Linear regression via plain f32 gradient descent
WFC Demo
Wave Function Collapse on a tiny tile grid
BLAS Demo
BLAS Demo: Comparing naive vs Accelerate-backed matrix operations
does not build: emcc: undefined symbol cblas_dgemm
LU Decomposition
LU / linear solve via stdlib BLAS (pattern-adoption #168)
does not build: emcc: undefined symbol cblas_dcopy
Learning
7 of 12 running
Small models and agents. The Metal and tape-runtime variants need host services that are not linked here.
FlowLM Char-LM
flowlm — train a character language model from scratch, in Flow
MLIR Tensor Bench
MLIR-first tensor benchmark — matmul + activations
NN Layers
Neural Network Layers
Optimizers
Neural Network Optimizers
Policy Pong
POLICY-PONG - REINFORCE policy gradient on headless pong
Q-Snake
Q-SNAKE - tabular Q-learning on headless snake
Tensor
Tensor demo — uses stdlib/tensor.flow
Digits MLP
Multi-class digits MLP trained from scratch on the CPU
does not build: emcc: undefined symbol flow_rt_monotonic_ns
Digits MLP (Metal)
Metal GPU status check for the digits MLP: what runs on the GPU today
does not build: emcc: undefined symbol flow_gpu_alloc
Digits MLP (parallel)
Data-parallel gradient accumulation for the digits MLP
does not build: emcc: undefined symbol flow_rt_monotonic_ns
GA Flappy
GA-FLAPPY - neuroevolution on headless flappy
does not build: emcc: undefined symbol fly
Tape Mul
Live reverse-mode Tape via ArrayTape (runtime/flow_tape.c)
does not build: emcc: undefined symbol flow_tape_reset
Systems and data
8 of 13 running
Allocators, hash tables, hashing, parsers, file formats. Anything asking the OS about itself stops at the link step.
CSV Parser
Streaming CSV parser demonstrating data processing in Flow
GIF Writer
Animated GIF from pure Flow: 24 frames of a square bouncing over a
Hash Table
Hash Table Implementation
Memory Pool
Memory Pool Allocator
Ring Buffer
Lock-Free Ring Buffer
SHA-256
SHA-256 Implementation
Shader Demo
FLOW Shader Demo
Text Demo
Text rendering: full character set, scales, alignment, numeric helpers
Arena Frame
Per-frame arena: bump allocate, then arena_reset each frame
does not build: emcc: site/wasm/arena_frame/arena_frame.c:81:9: error: redefinition of 'sizeof_i32'
Graphics
Graphics Module for FLOW
does not build: emcc: undefined symbol main
Manual Memory
Manual heap + arena demo (stdlib/memory.flow)
does not build: emcc: site/wasm/manual_memory/manual_memory.c:81:9: error: redefinition of 'sizeof_i32'
Runtime SHA-256
Crypto self-test via always-linked lib/runtime/crypto.flow
does not build: emcc: undefined symbol flow_sha256
System Info
System info demo in FLOW (extern-backed)
does not build: emcc: undefined symbol os_is_linux
What runs, and what is still being crossed
Only the first two rows are things verified in a browser
on this page. The rest name the mechanism and say plainly that it is not
built here yet.
Capability State Route
Pure computation
Runs today
Arithmetic, arrays, structs, strings, printf. Straight Flow to C to wasm32 with nothing else linked in.
gfx graphics and keyboard
Runs today
runtime/gfx_wasm.c paints the framebuffer onto a canvas and maps DOM key events to the macOS keycodes the programs already use.
Threads and channels
In progress
Emscripten -pthread over SharedArrayBuffer and Web Workers; needs the page to be cross-origin isolated. Not built here.
Sockets and HTTP
In progress
Emscripten's WebSocket-backed POSIX socket bridge (-lwebsocket.js / PROXY_POSIX_SOCKETS). Not built here.
GPU kernels
In progress
WebGPU, with WGSL generated from the same @gpu AST that already emits Metal. Not built here.
Embedded CPython
In progress
Pyodide, which is CPython itself compiled to WebAssembly. Not built here.
File I/O
In progress
Emscripten's MEMFS and IDBFS filesystems. Not wired into these pages.
Audio
Not attempted
The miniaudio and Metal audio backends have no browser counterpart here yet; WebAudio would be the route.
Built by python3 scripts/build_wasm_gallery.py.
Total payload 3.6 MB across 118 examples.
Machine-readable index: manifest.json .