Sprout
Sprout is a small language for games and simulations. It runs in your browser, on a phone as well as a desk, and you can change a program while it runs.
A taste
-- a cell: inputs | body double : [n | n * 2] [3, 1, 4] collect double print -- prints [6, 2, 8] -- math reads left to right 2 + 3 * 4 print -- prints 20 -- with makes a new record p : [x : 1, y : 2] p with [x : 5] print -- prints [x : 5, y : 2]
And the brain of every turret in Swarm, which you can change while they fire:
turret-program : [t | want : t dy atan2 (t dx) off : wrap (want - (t aim)) [turn : clamp [off * 6, -1, 1], fire : (t far < reach) and (t cool <= 0) and (off abs < 0.06)] ]
Ideas
- Everything is a cell. A function, a block, a list and a record are all written with square brackets.
- One rule for order: left to right. There is no precedence table to learn.
- No keywords for control.
else,times,matchandcondare ordinary cells in the library. - Values never change in place, so a running game can be rewound, saved or compared at any moment.
- A game is three cells:
start,updateanddraw. - Pure loops are compiled ahead. Loops over records of numbers are fused into one pass over columns,
sporkruns a million Monte Carlo trials on WebAssembly SIMD or the GPU, and WebGPU draws thousands of shapes in one call. - Games can be 3D:
view,block,modelandholddraw a scene with three.js and real CC0 models, from the same draw cell, andlightandskyset the light and put a sky with clouds overhead. - Two players, no server: send an invite by text, and two phones play in lockstep, peer to peer.
- Game logic you can rewrite mid-game: the turrets in Swarm and SilverEye run a
turret-programcell you edit while they fire, and SilverEye's simulants run asimulant-program. SilverEye's read plain words (it sees-someone,it off-target,it how-far), shows what each one knows as it plays, and puts every number in the game on a slider. - Dates, times, money, sizes and colours are written as they are:
2026-11-20 + 30,$19.99 * 3,640x480 / 2. parsereads text and code with rules that are ordinary values, and a grammar is one cell.- Code is data:
quoteit, change it,evalit. - Scripts are coroutines that stay values, so a game can rewind through them.
- Popular JavaScript libraries are wrapped as Sprout modules: chroma, simplex noise, math.js, date-fns, Fuse, compromise, Tone and Turf.
- The editor is made for touch: a big code area, live values beside each line, drag a number to tweak it, and history to scrub back through.
- The core is about fifteen hundred lines of JavaScript. The standard words, parse and speed live in libraries.
Try
- SwarmThousands of drones against turrets you program in Sprout.
- Orbit GardenA calm, modern one-thumb climber: tap to hop a seed of light between turning orbits as the sky turns from dawn to night. SPROUT·NOW's first game.
- FathomA portrait 16-bit slot roguelike on SPROUT·16: your reels are a bag of symbols you build, a monster every third dive, twenty-six relics and a hermit crab's salvage shop.
- Starlane 2025The first SPROUT·256 game: surf a glowing lane into a striped sunset, with four buttons in an arc to boost, jump, spin and bomb.
- Tide MachineA 16-bit slot-machine roguelike on SPROUT·16: lines of three or more pay, the sea wants its coins each tide, and a gull in a captain's hat sells charms that bend the rules.
- HeadstrongA 16-bit platform game on SPROUT·16: you are a big head with tiny feet, bouncing on bubbles, riding soap bars and head-butting cracked tiles through three bathroom rooms to a warm towel.
- Basketball Legends 8The 8-bit side of Basketball Legend, in an arcade cabinet: one on one from 1960 to forever, jump shots let go at the top of the jump, dunks, crossovers and blocks, a legend for every decade.
- Blade Beach '90A 1990 rollerblade warrior on SPROUT·8: jump hydrants and gaps, grind rails and kick masked gang skaters along the beach, the pier and the neon strip, then take on the roller-derby giant.
- Lily and ChesterAn 8-bit horse-caring game: a week of hay, apples, brushing and rides down the lane with Chester, then the county show and his ribbon.
- Brick SnapAn 8-bit block puzzle with toy bricks on SPROUT·8: snap them onto the baseplate, pop full rows and columns together, keep a streak going.
- Fizz JarAn 8-bit falling-pair puzzle: drop fizzy pairs into a soda jar and pop the grumpy sours four of a colour at a time; chains score double.
- Blended Zebra 8The endless black, white and red deckbuilder, small and 8-bit: fight with five cards and three energy, blend two cards into one at the oasis, climb as far as you can.
- Crate CoveAn 8-bit pushing puzzle on SPROUT·8: six coves of driftwood to push onto the tide marks, with undo and your fewest moves kept.
- Lantern KeepAn 8-bit maze game on SPROUT·8: light every lantern in a dark keep while shadow wisps hunt you down the corridors.
- Comet LanceAn 8-bit vertical shooter on SPROUT·8: waves of drones, darters and spinners, a boss every fifth wave, and P capsules that widen your shot.
- SprigAn 8-bit platform game across three gardens, on SPROUT·8: the console page any Sprout game can use, with a 64-colour screen, pixel art, square-wave music and a D-pad.
- SilverEyeA low-poly 3D shooter on the POCKET64 handheld: missions with objectives and medals, a combat sim against simulants, duel or co-op for two phones with no server, two maps. Turrets and simulants you program in Sprout as you play.
- VolleyTwo phones, one game, no server. The invite goes by text.
- GearsA parametric tool: two gears from a few numbers.
- TerrainSmooth noise and colour scales, from wrapped libraries.
- GalaxyTwenty thousand stars falling toward your finger.
- FirefliesFour hundred lights that gather where you touch.
- OrbitThrow moons round the sun.
- ACE, the Atomic Constraint EngineOne primitive, the atom, and done derived, never stored: a page that explains ACE with all eight examples running on it.
- ACE RiskA construction job run a million times with a risk register.
- TourThe language, one feature per line.
Read
- How SilverEye is madeA 3D shooter in one Sprout program, explained part by part.
- Sprout among the languagesSprout beside thirteen languages: a table, the same small programs side by side, what it borrowed and where others are better.
- Greenhouse, the experimental IDECode beside a running program: drag numbers, scrub time and edit the past, onion-skin trails, values at the end of every line, an inspector, the parse tree, and what-if forks.
- A Slightly Soggy Guide to SproutA storybook way in, with comics and a game you can water: two seedlings and a grumpy watering can teach you Sprout.
- The blogEvery change to Sprout, its library and its consoles, in a few lines, with a feed.
- The librarySixty-seven modules of our own, from calendars to slot reels, grouped by what you're making, two kits that draw, and nine wrapped libraries. Every example states its answer, and the build checks it.
- Sprout comparedNext to Python, Rebol, Clojure and Lua, each pair run.
- The specSprout 3: how it reads and runs, the numbered design decisions behind it, and the old Sprout 2.0 kept as history.
- BenchmarksMeasured in your browser, on your device.
- Monte CarloA short history, from Buffon's needle to today.