cr8script   ·   plate I.I
github ↗
plate I.I · the language
i / iv

cr8script·atlas

an atlas of a small language, drawn for the agents who write it

cr8script is an English-shaped scripting language for LLMs and anyone who wants quick scripts without Python's footguns. One file. No build. No imports. It refuses truthy/falsy, refuses silent type mixing, and prints 0.1 + 0.2 = 0.3 exactly — decimal-safe by default, useful for finance, billing, and reporting scripts where Python's float footguns would silently corrupt totals. Pipelines on lists of records read like SQL; errors name the line, the value, and the fix.

chart key Syntax Pipelines Types Built-ins Tooling Principles
plate I.II · the atlas
ii / iv
fig. i -- the language, charted by category generated by examples/make_mindmap.cr8
plate II.I · what makes it different
iii / iv

The premise is unfashionable: a language whose refusals are the feature. cr8script will not let "5" + 3 be a string. It will not let if 0 then be falsy. It will not silently swallow a typo'd field name. The error messages know the line and the value, and offer a fix.

refused, by design

truthy / falsy * == != >= <= * silent type coercion * null / undefined * classes & methods

kept, with intent

let & var * nothing * is at least * for each in * group by * summarize * f"{x}"

made for agents

A surface so small that an LLM rarely gets it wrong. The static checker emits { line, message, hint } JSON so a model can self-correct before running.

plate II.II · a taste
iii / iv

a taste, in cr8

fig. ii -- pipelines · group by · summarize
sample.cr8# sales -- list of records
let sales = [
  { product: "widget", region: "east", amount: 12.50 },
  { product: "gadget", region: "east", amount:  8.00 },
  { product: "widget", region: "west", amount: 15.00 },
  { product: "doodad", region: "east", amount: 99.00 },
]

let by_product = sales
  | group by product
  | summarize { total: sum(amount), n: length(items) }
  | sort by total descending

for each row in by_product
  show f"{row.product}: {row.total} across {row.n} order(s)"
end
stdoutdoodad: 99 across 1 order(s)
widget: 27.5 across 2 order(s)
gadget: 8 across 1 order(s)
plate III.I · six provinces
iv / iv

the six provinces

fig. iii -- the whole surface area
i. syntax

Syntax

  • let immutable · var mutable
  • to name(...) defines a function · end closes the block
  • if · then · else · end -- also an expression
  • for each n in 1..5
  • repeat 3 times
  • try / otherwise as err
  • f"hello {name}" interpolation
ii. pipelines

Pipelines

  • where · filter
  • sort by · ascending / descending
  • take · first n
  • map · transform
  • group by · yields {key, items}
  • summarize { ... } · roll up
  • bare names auto-resolve to record fields
iii. types

Types

  • number -- one decimal type, 0.1+0.2=0.3
  • text -- sealed strings, no coercion
  • boolean -- only in conditions, no truthy/falsy
  • list -- 1-based indexing
  • record -- values, not objects
  • nothing -- the only absence
iv. built-ins

Built-ins

  • math · sqrt · pow · pi · e
  • http · get returns { ok, status, body }
  • time · now · sleep
  • json · parse · stringify
  • csv · parse · write
  • sum / count / average / min / max
v. tooling

Tooling

  • pip install cr8script · one command on PATH
  • --check-json · structured diagnostics for agents
  • --test · golden suite
  • tour.cr8 · the language end-to-end
  • AGENTS.md · system-prompt template + tool defs
  • LLM_MAP.md · typed planning graph
vi. principles

Principles

  • One way to do each thing
  • No invisible syntax -- blocks end with end
  • Reads like English
  • Strong, honest types
  • Errors that teach (line · value · hint)
  • Determinism over cleverness
plate IV.I · run it
v / vi

run it

python 3.9+ · one file · no dependencies
$ pip install cr8script install
$ cr8script --example tour language tour
$ cr8script --help all flags
$ cr8script --check-json file.cr8 llm correction loop
plate IV.II · for language models
vi / vi

for language models

discovery · llmstxt.org · self-correction

cr8script is built so an agent can write it correctly the first time. Five surfaces exist for that purpose:

  • /llms.txt -- discovery file at this site's root, following the llmstxt.org convention. A pointer table, in markdown.
  • LLMS.md -- a condensed grammar & rules sheet inside the language repo. Hard rules first, then the cheat sheet, then idioms.
  • AGENTS.md -- the operational playbook: a paste-able system-prompt block, tool definitions for cr8_check / cr8_run, and a task-shape pointer table. Everything you need to wire cr8script into an agent loop.
  • LLM_MAP.md -- a typed planning graph that sits between prompt and .cr8 generation. Forces the model to externalize goals, inputs, transforms, decisions, risks, outputs, and checks before writing code. Has its own validator (tools/check_map.py) that mirrors the --check-json shape.
  • --check-json emits { line, message, hint } diagnostics -- iterate against the static checker before running.
  • Longer-form pages on the same topic: principles (the design defended), cookbook (recipes for common tasks), and cr8 vs python (four scenarios where Python is silent and cr8 is loud).