Skip to content

Built with Milo ​

Real programs written in Milo. Most are a single .milo file in examples/; the bigger ones — the emulators and milojs — have their own repos. Run or build any of them yourself with the ./milo wrapper. They double as integration tests for the standard library.

What do you want to build today? ​

Pick what you have in mind. Each row jumps to real, runnable examples further down this page, and to the docs that teach the language features they lean on. New to Milo? Start with the Language Tour.

I want to build…See it workingLearn the pieces
A game or console emulatorEmulators, graphics demosOwnership, Concurrency, FFI (SDL)
A web server or APIServers & network appsError handling, Concurrency, Get started
A command-line toolCLI toolsYour first program, Strings, Collections
A terminal app (TUI)Terminal & graphics appsConcurrency: green tasks & Select
A debugger or dev toolDebugger: dapweb, java-dapFFI, Modules
A language or interpreterData & interpreters, the prover and formatterEnums & pattern matching, Ownership
Low-level / embeddedflightControllerSafety, FFI

Emulators ​

Three retro-console cores, each a native binary on desktop with SDL video, audio and input. Drop a ROM and play. The in-browser builds are paused: they compiled through the JavaScript backend, which was removed in favour of LLVM's --target=wasm64, and come back once the cores build for it.

NES ​

Cycle-stepped 6502, PPU, and APU with DMC audio and multiple mappers. Ships six free homebrew games: Blade Buster, Battle Kid, Super PakPak, Sir Ababol, Lawn Mower, Mad Wizard. Drag in your own .nes ROM to play anything else.

Super Mario Bros. 3 running on the Milo NES emulator

Genesis / Mega Drive ​

Motorola 68000 + Z80 dual-CPU core with the VDP graphics processor and FM/PSG audio. Preset homebrew: Headship, Astro Perdido, Gravity Pig, Dragon's Castle. Accepts .md / .bin / .gen / .smd ROMs.

Sonic the Hedgehog running on the Milo Genesis emulator

SNES ​

65C816 CPU plus the SNES PPU, including a Super FX (GSU) coprocessor core. Plays Super Mario World and Donkey Kong Country; Star Fox boots with GSU-rendered 3D. Preset homebrew: UWOL: Quest for Money, Super Boss Gaiden, BLT, Bucket, Mega Family Bros, Hilda. Load your own .sfc / .smc ROM to play anything else.

Super Mario World running on the Milo SNES emulator

All three live in milo-language/emulators: ./arcade.sh <rom> builds the right core with SDL video, audio, and input. retro/ turns them into a Raspberry Pi couch console with a gamepad-driven menu.

Debugger ​

dapweb ​

dapweb stopped at a breakpoint inside classify(), showing the source view, call stack, locals, and a live lldb terminal

A web + AI interface for any DAP debugger (lldb-dap, debugpy, delve), written in Milo. One binary, two subcommands: dapweb web serves a React + Monaco + xterm.js debugging UI from a Milo HTTP/WebSocket server: breakpoints, stepping, call stacks, expandable locals, watch expressions, an ARM64/x86 disassembly pane, and a real PTY terminal you can type into while your program runs. dapweb api drives that same session from the CLI — every verb is the JSON the browser sends, so an agent or a shell script and a human share one debuggee. Debugs Milo binaries too; the compiler emits standard DWARF.

java-dap ​

A standalone Debug Adapter Protocol server for the JVM, written in Milo. No Eclipse, no jdt.ls, no JVM-side code: the whole adapter is a DAP-to-JDWP protocol translator in about 1300 lines. Works with any DAP client, and dapweb finds it automatically, so you can debug Java the same way you debug Milo.

Terminal & graphics apps ​

TUIs in examples/terminal/ and examples/graphics/, built on the standard library's terminal, PTY, SDL, and green-thread APIs.

ProgramWhat it is
tetrisEvent-driven terminal Tetris; one green task parked on a Select, no polling
sysmonhtop-style live system monitor
donutThe classic spinning 3D torus, truecolor-shaded
plasmaFull-screen truecolor animation; doubles as a render-throughput benchmark
aquariumTruecolor pixel aquarium: fish, bubbles, swaying seaweed
chihuahuaDVD-logo-style bouncing screensaver with a shaded pixel-art sprite
raytrace3dReal-time Whitted ray tracer: chrome spheres, shadows and rigid-body physics at 60fps on the CPU
raytracerProgressive Monte-Carlo path tracer: soft shadows and colour bleed from the bounce integral
renderOffline path tracer: glass, metal, a low sun and depth of field at 1920x1080, rendered across every core with std/shard and written by std/png
FLYBY3D flying game over real places (Manhattan, San Francisco, Honolulu, the Grand Canyon): SRTM terrain, OpenStreetMap buildings, aerial imagery, and the live weather over each city, on OpenGL 3.3
clothPosition-based dynamics cloth; grab a node and fling it
phasespaceCollisionless Vlasov plasma solver (MUSCL, Strang splitting) winding trapped-particle vortices
splitPtyTwo commands side-by-side in real PTYs; a mini tmux
flightControllerSingle-axis PID altitude controller with an interactive TUI
menuFullscreen SDL retro-console front-end with a gamepad/keyboard ROM picker

Servers & network apps ​

ProgramWhat it is
termpairShare your terminal in the browser: WebSocket relay with end-to-end AES encryption, client and server both in Milo
weatherweather.gov + Open-Meteo frontend served from a single static binary: forecast, UV index, air quality, 17k-place typeahead
serveStatic file server with directory listing
webserverHTTP server with routing, path params, middleware
httpClientHTTP client for fetching URLs
fetchFetch an HTTP API over TLS and parse the JSON response

Data & interpreters ​

ProgramWhat it is
milojsA JavaScript engine in Milo: parser, evaluator, mark-sweep GC. Runs express
kvstorePage-based key-value store with cursors, in the sled/buffer-pool style
minilangTree-walking interpreter for a small expression language

The language, feeding itself ​

ProgramWhat it is
smtSolveThe SMT solver behind milo prove. Milo's contracts are discharged by a Milo binary
fmtThe Milo source formatter, in Milo

CLI tools ​

Coreutils-style tools in examples/cli-tools/, each a single .milo file.

ProgramWhat it is
grepPattern search with color, -i / -n / -c / -v
rgripgrep-lite: regex-powered recursive search
jqJSON query tool
treeRecursive directory tree with depth limiting
catFile viewer with line numbers and syntax highlighting
wcLine/word/char counter
hexHex dump viewer with ASCII column
shufShuffle input lines
calcExpression evaluator
parallelRun shell commands in parallel across input lines (fork-based)
timeoutRun a command with a time limit

Run these yourself ​

Clone the repo and run or build any of the examples/ programs with the ./milo wrapper:

bash
./milo run examples/cli-tools/grep.milo -- "hello" myfile.txt
./milo build examples/net/serve.milo -o serve && ./serve

The emulators and milojs live in their own repos; clone them next to an installed milo and run them the same way:

bash
git clone https://github.com/milo-language/milo-emulators && milo-emulators/arcade.sh <rom>
git clone https://github.com/milo-language/milojs && milo run milojs/milojs.milo app.js

A taste: grep in Milo ​

milo
from "std/argparse" import { ArgParser }
from "std/fs" import { readFile }

fn main(): i32 {
    var parser = ArgParser.new("grep", "search for a string pattern in files")
    parser.addPositional("pattern", "string pattern to search for")
    parser.addPositional("file", "file to search")
    parser.addBool("ignore-case", "i", "case-insensitive search")
    parser.addBool("line-number", "n", "show line numbers")
    parser.addBool("count", "c", "only print count of matching lines")
    let args = parser.parse()

    let pattern = args.getString("pattern") ?? ""
    let filePath = args.getString("file") ?? ""

    let content = readFile(filePath)!
    let lines = content.split("\n")

    for line in lines {
        if line.contains(pattern) {
            print(line)
        }
    }
    return 0
}