Mix — manual

The reference manual for the Mix language, one page per topic. The canonical home of these pages is docs/_man/ in the public markc/mix repo; add a page by dropping TOPIC.md there. The same files render everywhere:

  • Terminalmix man TOPIC (mix man alone prints this index).
  • mix man — reads cosmix.dev/mix, a mirror of this directory in the cosmix repo ($COSMIX/mix/). It is kept in step automatically: the mix repo's post-commit hook runs $COSMIX/build/sync-man.mix whenever a page here is committed (copy, prune, regenerate HTML stubs, commit, push). If mix man looks stale, run that script by hand and check ~/.cache/cosmix/man/ (24 h cache).
  • Webmarkc.github.io/mix serves the manual in the site's left-hand Manual pane; any page deep-links as #_man/PAGE.md.
  • GitHub — browse docs/_man/ directly; this file doubles as the directory README.
  • Local clone — plain markdown with relative links; any editor or viewer works.

Start here

The language

Builtins & I/O

  • math — rounding, powers, logs, trig, min/max/clamp, constants.
  • files & I/Oread_file/write_file/glob/stat/chmod/walk/…
  • processes & systemrun/run_rc/run_stream/spawn/env/exit/…
  • data & serialization — JSON, TOML, jq, data_encode, strict-data .mix.
  • byte buffersbuffer/buffer_push/freeze, the one reference-semantic type.
  • regular expressionsre_match/re_find/re_replace/re_split/grep_lines (subject first).
  • dates & timetime/date_format/now_iso/duration_format.
  • httphttp_get/http_post/http_request, deadlines.
  • datastards_* SSE event framing.

Mesh & runtime

Reference

Design docs & specs

Design docs, background rationale, and the formal specs (04 language reference, 18 citizen runtime) all live in the operator control repo since 2026-07-23; this manual is the complete public reference.

See also

mix help              the full categorized builtin reference
mix builtins [CAT]    list builtins, optionally by category
mix what NAME         one-line description of a builtin or keyword
mix man TOPIC         read any of the pages above in the terminal

For AI agents: AGENTS.md at the repo root is a short orientation sheet whose canonical reference is this manual.