cr8script   ·   plate I.I
edition v1.1 · 2026
github · LofiFren/cr8script ↗
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. 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

  • REPL · python3 cr8script.py
  • --check · static field-access checks
  • --check-json · structured for LLMs
  • --test · golden suite
  • --lex / --ast · debug dumps
  • tour.cr8 · the language end-to-end
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+ · no pip · no flags
$ python3 cr8script.py examples/tour.cr8 language tour
$ python3 cr8script.py repl
$ python3 cr8script.py --test golden suite
$ python3 cr8script.py --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. Two files 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.
  • --check-json emits { line, message, hint } diagnostics — iterate against the static checker before running.