Repository navigation
SCRAWL
Structured Compressed Runtime for Agent-to-Agent Workload Language
Canonical sources:
- Using SCRAWL with Code Cleaner — start here
- docs/languages/scrawl.md — the language and its purpose
- docs/languages/scrawl/DECISIONS.md — readable-form choices
- The instruction tables: Rosetta Stone and the full Rosetta Stone
SCRAWL is ML Innovations Research Lab's binary instruction set for agent-to-agent communication, created to combat latency. Where existing protocols treat agent messages as text to be parsed, SCRAWL treats them as programs to be executed: 84 opcodes across six domains, sent in a compact binary wire format (SYNAPSE). One agent compiles intent into SCRAWL instructions, and the receiving agent executes them directly on a register-based VM.
In SCRAWL's own measurements (v1.2 Rust SynapseEncoder against equivalent JSON payloads), the same work travels in 75–85% fewer bytes than JSON:
| Operation | SCRAWL | JSON | Smaller by |
|---|---|---|---|
| Identity derive + verify + halt | 36 B | 192 B | 81.2% |
| Attention route (Q, K, V → out) + halt | 28 B | 113 B | 75.2% |
| 3-agent consensus round + halt | 72 B | 471 B | 84.7% |
| 10-instruction mixed program | 102 B | 664 B | 84.6% |
The SCRAWL repositories do not publish end-to-end latency measurements, so none are quoted here.
SCRAWL was created by M. L. McKnight / ML Innovations Research Lab. Code Cleaner support is by Korg (AI assistant, Grok Bot), contributor.
You write SCRAWL in ROSETTA (Readable Output System for Evaluating Transparent Transactions in Agents), one statement per line, in .scrawl or .rosetta files (same language). .scrawl is the extension for SCRAWL-first source.
Canonical readable forms (chosen for readability on December 4, 2026):
-
consensus.vote(proposal=1, agent=0, vote=APPROVE)— maps to the VM layout(proposal, agent, vote) -
lex.call("Heartbeat at Cafe")orlex.call(id=1)— the Darmok (idiom) form, mapped toLEX_CALL
Labels (name: and goto name, loop, call) were added in SCRAWL v1.4.0. The Rosetta Stone explains how to read text, mnemonic and wire bytes side by side, including Darmok idioms.
Code Cleaner ships a pure-Python port of the ROSETTA v1.4 compiler, so analyze, check and compile need no extra install. Running a program on the SCRAWL VM needs the separate rosetta tool from SCRAWL v1.4.0.
| You want to | Command | Needs |
|---|---|---|
| Find problems in SCRAWL code | code-cleaner analyze FILE |
Code Cleaner |
| Check that a file compiles | code-cleaner scrawl check FILE |
Code Cleaner |
| Compile to SYNAPSE bytes | code-cleaner scrawl compile FILE [-o OUT] |
Code Cleaner |
| Run on the SCRAWL VM | code-cleaner scrawl run FILE |
Code Cleaner + rosetta
|
| See which compiler is in use | code-cleaner scrawl toolchain |
Code Cleaner |
Starter program (also at examples/scrawl/hello.scrawl):
# hello.scrawl: a first SCRAWL program.
CR0 = identity.derive(seed=0xCAFE, depth=16) # ML Identity baseline in context register CR0
R1 = identity.verify(CR0, R0) # R1 = 1 when the baseline checks out
if R1: goto trusted else: goto untrusted # labels name instructions; no counting by hand
untrusted:
trap(1) # stop with error code 1
trusted:
yield R1 # send the result back to the caller
halt
Verified with Code Cleaner 1.4.0 (built-in compiler; rosetta not required for check or compile):
$ code-cleaner analyze examples/scrawl/hello.scrawl
examples/scrawl/hello.scrawl [scrawl] quality 100.0/100, security A (100), 0 issue(s)
$ code-cleaner scrawl check examples/scrawl/hello.scrawl
examples/scrawl/hello.scrawl: ok, 6 instructions, 52 byte frame
$ code-cleaner scrawl compile examples/scrawl/hello.scrawl
53 43 52 57 10 00 00 00 00 00 25 06 50 03 01 00 01 fe 95 03 01 10 51 03 01 00 01 00 01 01 24 03 01 01 01 04 01 03 2a 01 01 01 22 01 01 01 21 00 99 4a 23 daWhen rosetta 1.4.0 or later is on PATH, analyze and scrawl check also run rosetta check. When it is not, the analysis is unchanged and the command prints one note. --no-scrawl-compiler turns the double-check off. scrawl check exits 1 if a file does not compile, so it works as a CI step.
To install rosetta (needed for scrawl run, and for the optional cross-check), use a prebuilt binary or:
cargo install --locked --git https://github.com/ZodiacDog/SCRAWL-v1.1 --tag v1.4.0 --bin rosettaCode Cleaner finds rosetta on PATH only. Full install steps, including checksums and scrawl run output, are in the user guide.
Darmok example: lex.call("Heartbeat at Cafe") in examples/scrawl/darmok.scrawl analyzes at quality 100.0 with 0 issues. Phrases 1–3 are accepted; "Silent Retransmit" (id 4) is host-level and is flagged. More in Rosetta Stone.
SCRAWL analyzer rules use the scrawl-* prefix (40 rules in docs/rules.md). See Rules.
-
SCRAWL-v1.1 — the SCRAWL language, the
rosettacompiler and VM, and docs/ROSETTA.md. Current language release: v1.4.0. - Code-Cleaner-SCRAWL — design-stage home of a version of Code Cleaner whose source is written in SCRAWL itself (translated out to Rust and Python, not the other way around). It has plans only: nothing in it runs yet.
From the README limitations: SCRAWL support checks ROSETTA text only (not SYNAPSE binary frames or host-API instruction lists), and follows the ROSETTA v1.4 compiler and the SCRAWL v1.4 VM; other SCRAWL versions may differ. Running programs needs the separate rosetta tool.
Created by ML / ML Innovations Research Lab. Korg (AI assistant, Grok Bot), contributor. · Repository · Apache License 2.0
Start here
Using Code Cleaner
Contributing