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)

canvas 33 KB source

Asteroids

ASTEROIDS - Complete Implementation

canvas 37 KB source

Breakout

BREAKOUT - Complete Implementation

canvas 32 KB source

Checkers

CHECKERS - two-player hotseat

canvas 45 KB source

Chetris

Chetris: Chess + Tetris Hybrid (Graphical Version)

canvas 37 KB source

Connect Four

CONNECT FOUR vs AI

canvas 34 KB source

Flappy

FLAPPY - Complete Implementation

canvas 31 KB source

Frogger

FROGGER - Complete Implementation

canvas 35 KB source

Jumper

JUMPER - doodle-jump style vertical platformer

canvas 33 KB source

Lane Racer

LANE RACER - top-down 4-lane racing game

canvas 32 KB source

Lights Out

LIGHTS OUT - Complete Implementation

canvas 32 KB source

Match-3

MATCH-3 - Complete Implementation

canvas 43 KB source

Maze Chase

MAZE CHASE - Pac-Man style maze game

canvas 36 KB source

Minesweeper

MINESWEEPER - Complete Implementation

canvas 43 KB source

Missile Command

MISSILE COMMAND - Complete Implementation

canvas 48 KB source

Othello

OTHELLO / REVERSI vs AI

canvas 45 KB source

Pong

PONG - Complete Implementation

canvas 31 KB source

Simon

SIMON - memory game

canvas 42 KB source

Snake

SNAKE - Complete Implementation

canvas 41 KB source

Sokoban

SOKOBAN - Complete Implementation

canvas 33 KB source

Space Invaders

SPACE INVADERS - Complete Implementation

canvas 37 KB source

Tetris

TETRIS - Complete Implementation

canvas 36 KB source

Tower of Hanoi

TOWER OF HANOI - classic disk puzzle

canvas 43 KB source

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

canvas 34 KB source

Branching Vessels

leaf venation by space colonization

canvas 49 KB source

Cahn Hilliard

phase separation and spinodal decomposition

canvas 34 KB source

Cell Sorting

differential adhesion, and tissue layers that sort

canvas 40 KB source

Coral Ballistic

ballistic deposition and the shadowing instability

canvas 34 KB source

Cyclic CA

spirals out of pure noise

canvas 34 KB source

DLA

growth where the shape is the history

canvas 46 KB source

Eden Growth

a compact cluster with a rough surface, and the roughness

canvas 34 KB source

Gray Scott

the canonical morphogenesis model

canvas 37 KB source

Heat Morph

anisotropic diffusion sculpting a shape out of noise

canvas 33 KB source

Hexagonal CA

snow crystal growth on a triangular lattice

canvas 35 KB source

L-System Plant

a stochastic rewriting grammar, drawn as it grows

canvas 42 KB source

L-System Tree

a three-dimensional branching grammar, projected and

canvas 41 KB source

Life Variants

three outer-totalistic rules on the same soup

canvas 33 KB source

Slime Mold

Physarum agents building a transport network

canvas 42 KB source

Somite Clock

segmentation by a clock and a wavefront

canvas 53 KB source

Swift Hohenberg

rolls and hexagons from a wavelength-selecting operator

canvas 34 KB source

Turing Spots

the activator-inhibitor system behind animal coats

canvas 35 KB source

Turing Stripes

the same activator-inhibitor system, one parameter away

canvas 35 KB source

WFC Growth

structure appearing by constraint propagation

canvas 39 KB source

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

console 17 KB source

Declarative Sort

Declarative ordering (Phase 1)

console 26 KB source

Dot Product

console 17 KB source

Factorial

Factorial - FLOW version of C++ factorial example

console 17 KB source

Fibonacci

console 17 KB source

GCD

Greatest Common Divisor - FLOW version of C++ Euclidean algorithm

console 17 KB source

Hello WASM

Minimal Flow program for the WASM path (Flow → C → emcc)

console 24 KB source

Hello World

Hello World in FLOW

console 17 KB source

Loops

Loop examples in FLOW

console 17 KB source

Match Enums

Basics: match on a simple enum

console 24 KB source

Palindrome

Palindrome Checker - FLOW version of C++ string palindrome

console 17 KB source

Pipeline Choose

Pipeline `choose` — a state-driven stage that picks which pipeline runs

console 24 KB source

Pipeline Fork

Pipeline fork block — apply several pipelines to one value, collect a record

console 24 KB source

Pipeline Fork Inferred

Anonymous fork block — the record type is inferred, no struct declaration

console 24 KB source

Pipeline Placeholder

Pipeline placeholder `_` — route the piped value to any argument slot

console 24 KB source

Power

Power Function - FLOW version of C++ pow() function

console 17 KB source

Prime Numbers

Prime Numbers - FLOW version of C++ prime number checker

console 18 KB source

Result Pipeline

Result pipeline — chain fallible steps with stdlib Result helpers

console 24 KB source

Simple For

console 20 KB source

Simple Search

Simple Search - FLOW version

console 17 KB source

Spans

Spans: a borrowed view over contiguous storage

console 17 KB source

Type Safety Demo

Advanced Type Safety with Type Aliases and Distinct Types

console 20 KB source

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

console 29 KB source

Calculator

Expression Calculator

console 31 KB source

Claim Address Demo

Claim Coordinates demo — Flow port of src/flow/claim_address.py

console 31 KB source

Closures Demo

Closures/Lambda Demo

console 25 KB source

Composition Car Engine

Composition Example: Car has-an Engine

console 17 KB source

Composition Team Employee

Composition Example: Team has Employees

console 17 KB source

Dependency Injection

Dependency Injection via Effects

console 29 KB source

Effect Rows

Effect-row Phase 2: declare effects on the signature with `with E`

console 27 KB source

Enum Match Exhaustive

Enum/ADT match demo - exercises path/const patterns and exhaustiveness

console 24 KB source

Enums Demo

Enums / Algebraic Data Types Demo

console 25 KB source

Flow Identifier Lexer

Flow identifier / keyword lexer (self-hosting seed)

console 22 KB source

Flow Lexer

Flow lexer Phase 2 (self-hosting) — historical seed demo

console 24 KB source

Generics Demo

Generics Demo

console 28 KB source

Know Demo

know + fingerprint dogfood

console 36 KB source

LSP Ordering Port

Flow port of src/flow/lsp_ordering.py — ordering IntelliSense strings

console 20 KB source

Math Prose Demo

math_prose + proof_sub dogfood demo

console 34 KB source

OOP Counter

OOP-style Example: Counter with encapsulated state

console 17 KB source

OOP Person

OOP-style Example: Person with "method" function

console 17 KB source

Option Result Demo

Option and Result Types Demo

console 28 KB source

Showcase

Effect System Showcase: One Service, Many Worlds

console 30 KB source

State Effects

State Effects: Policy Effects with Explicitly-Threaded State

console 32 KB source

Traits Demo

Demonstrates trait-based polymorphism

console 28 KB source

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

console 23 KB source

GA + WFC Coupled

GA + WFC coupled pipeline via dsys syntax

console 47 KB source

GA Control

GA search for stabilizing feedback on discrete double integrator

console 28 KB source

GA Dsys (namespaced)

Same GA + sense pipeline as ga_dsys_syntax.flow, using the dynamics namespace

console 43 KB source

GA Dsys Syntax

GA + control analysis via the dsys surface syntax

console 44 KB source

GA Full Analysis

GA control search + unified dynamical systems analysis

console 43 KB source

Gramian Demo

Finite vs infinite horizon controllability Gramian

console 22 KB source

LU Decomposition (pedagogical)

LU Decomposition (pedagogical) — hand-written Doolittle / pivoted LU

console 31 KB source

Lorenz Attractor

Lorenz attractor integration + Lyapunov separation proxy

console 21 KB source

Matrix Ops

Basic Matrix Operations

console 30 KB source

Natural Physics

Natural Physics in Flow

console 20 KB source

Natural Syntax Demo

Natural Physics Syntax Demo

console 28 KB source

ODE Solver

Ordinary Differential Equation Solvers

console 34 KB source

Optimization

Numerical Optimization

console 31 KB source

Regression (GD)

Linear regression via plain f32 gradient descent

console 28 KB source

WFC Demo

Wave Function Collapse on a tiny tile grid

console 19 KB source

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

console 76 KB source

MLIR Tensor Bench

MLIR-first tensor benchmark — matmul + activations

console 29 KB source

NN Layers

Neural Network Layers

console 30 KB source

Optimizers

Neural Network Optimizers

console 29 KB source

Policy Pong

POLICY-PONG - REINFORCE policy gradient on headless pong

console 36 KB source

Q-Snake

Q-SNAKE - tabular Q-learning on headless snake

console 31 KB source

Tensor

Tensor demo — uses stdlib/tensor.flow

console 29 KB source

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

console 27 KB source

GIF Writer

Animated GIF from pure Flow: 24 frames of a square bouncing over a

console 77 KB source

Hash Table

Hash Table Implementation

console 28 KB source

Memory Pool

Memory Pool Allocator

console 26 KB source

Ring Buffer

Lock-Free Ring Buffer

console 27 KB source

SHA-256

SHA-256 Implementation

console 27 KB source

Shader Demo

FLOW Shader Demo

console 25 KB source

Text Demo

Text rendering: full character set, scales, alignment, numeric helpers

canvas 32 KB source

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.

CapabilityStateRoute
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.