An English-Shaped Scripting Language for LLMs

cr8script

Quick scripts without Python's footguns. One file, no build, no imports -- it reads the way you'd describe the work out loud. No truthy/falsy, no float surprises, errors that teach. Install from PyPI.

PyPI version License Python 3.9+ Website
Try the Playground Install from PyPI View on GitHub
Install
$ pip install cr8script
A taste -- pipelines that read like English
let sales = [ { product: "widget", region: "east", amount: 12.50 }, { product: "gadget", region: "east", amount: 8.00 }, { product: "widget", region: "west", amount: 15.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 --> widget: 27.5 across 2 order(s) --> gadget: 8 across 1 order(s)

What Makes It Different

Designed so an LLM (or a human in a hurry) can write a correct script the first time -- and get a teaching error the rare time it doesn't.

Reads like English

is greater than, is at least, for each, where, sort by. No ==, !=, >=, <= to fumble.

Honest types

No truthy/falsy. "5" + 3 is an error. 5 is "5" is an error. if 0 then is an error. Nothing silently coerces.

Honest decimals

0.1 + 0.2 is exactly 0.3. One number type -- no binary-float papercuts.

No null surprises

Only nothing. A missing key returns nothing; a misspelled field is a hard error with a "did you mean" hint.

Immutable by default

let is forever; var opts into change. Mutation is a choice you make on purpose.

Pipelines first-class

where, sort by, take, map, group by, summarize -- bare names inside resolve to record fields.

Errors that teach

Every error names the line, the offending value, and a one-line hint. No stack-trace archaeology.

LLM-shaped diagnostics

--check-json emits structured { line, message, hint } so a model can self-correct before it ever runs the script.

Built for Language Models

cr8script ships the scaffolding to wire it into an agent: a grammar sheet, a structured self-correction loop, and a typed planning layer between prompt and code.

1

Grammar Sheet

LLMS.md is a condensed grammar + rules reference written for a model to read first. AGENTS.md adds a system-prompt template and tool definitions.

On GitHub →
2

Self-Correction Loop

--check-json returns structured diagnostics the model fixes against, then runs. A broken-to-fixed worked example ships in examples/agent_loop/.

See the demo →
3

LLM-Map Planning

LLM_MAP.md defines a typed planning-graph layer that can sit between the prompt and the generated .cr8 -- plan first, emit code second.

Language tour →

Status & Highlights

A single-file interpreter you can read in an afternoon. The language is independent of Python -- only the bootstrap isn't.

One file, zero dependencies -- cr8script.py is a ~3k-line lexer, parser, tree-walking evaluator, REPL, and static checker. Python 3.9+.
On PyPI -- pip install cr8script, then cr8script --example tour for the language tour or cr8script for the REPL.
Batteries included -- built-in math, http, time, json, and csv modules, plus top-level helpers like sum, average, keys, and assert.
cr8script.com -- a language tour, an animated atlas of the grammar, and a playable in-browser demo. No install needed to try it.
VS Code extension -- syntax highlighting and a static checker for .cr8 files, backed by a standalone linter.