Repository navigation
SCRAWL users can now write, check, compile and run SCRAWL with Code Cleaner. The core still has no
third-party dependencies.
- Built-in ROSETTA v1.4 compiler.
code_cleaner/languages/scrawl_rosetta.pyis a pure-Python port
of the SCRAWL v1.4.0 compiler (src/rosetta.rs): the same 93 statement forms, the raw
MNEMONIC(operands)form, macros, the namedconsensus.voteandlex.callforms, labels, and the
SYNAPSE frame encoder with CRC-32C. It produces the same bytes and the same error messages as the
Rust compiler; a differential test checks this against the realrosettabinary in CI. - The SCRAWL analyzer follows SCRAWL v1.4 instead of ROSETTA v1.1 and the v1.2 VM
(docs/languages/scrawl/DECISIONS.md, decision 9). When v1.1 and the VM disagree on operand order,
the VM wins, and legacy v1.1 forms are flagged (scrawl-vote-operand-order,scrawl-legacy-form).
X_LOOP(loop R1: goto top),S_WATCHand the raw form compile;X_BRANCHelse targets are
honored. Every line the compiler rejects is reported with the compiler's own message.- New rules:
scrawl-label-undefined,scrawl-label-duplicate,scrawl-label-name,
scrawl-label-unused,scrawl-legacy-form,scrawl-compile-error, and the style rules
scrawl-numeric-targetandscrawl-raw-form.scrawl-unreachablenow follows jumps, so it also
finds code that every branch skips, not only code afterhalt. - Removed rules, which no longer apply:
scrawl-comment-spacing(any#starts a comment),
scrawl-macro-truncated(macros expand in full),scrawl-branch-else(the VM honors else),
scrawl-call-args(call arguments compile),scrawl-agent-list-itemandscrawl-register-range
(now compile errors:scrawl-bad-operand,scrawl-register-bounds). - New metrics:
scrawl_instructions,scrawl_frame_bytes,scrawl_labels,scrawl_compiles,
scrawl_compiler.
- New rules:
- Optional
rosettaintegration (code_cleaner/languages/scrawl_toolchain.py). If SCRAWL's
rosettatool 1.4.0 or later is onPATH,analyzealso runs
rosetta checkon each SCRAWL file and reports any line it rejects (scrawl-compile-error). If it
is not installed, the analysis is unchanged, nothing is scored, and the CLI prints one note.
--no-scrawl-compiler/scrawl_compiler: offturns it off. code-cleaner scrawlcommands:check FILE...(exit 1 on a compile error),compile FILE [-o OUT](SYNAPSE bytes as hex, or a binary file),run FILE(runs on the SCRAWL VM through
rosetta run; exit 2 with install instructions ifrosettais missing) andtoolchain.
code-cleaner versionshows the rosetta status.- Docs: a new user guide, Using SCRAWL with Code Cleaner
(install, first program, analyze, compile, run, the Rosetta Stone, Darmok idioms);scrawl.md,
the Rosetta Stone (new section: labels and the raw form),DECISIONS.md(decisions 8 and 9), the
README anddocs/rules.mdupdated. - Examples: a starter program,
examples/scrawl/hello.scrawl;countdown.rosetta(labels and a
loop) and the canonical-voteconsensus_round.rosettafrom SCRAWL v1.4.0. - CI: a new
scrawl-rosettajob installsrosettatwo ways (the SCRAWL v1.4.0 prebuilt release
binary, checked againstSHA256SUMS, andcargo installfrom the tag) and runs the differential
test, the examples on the VM and thescrawlcommands. - Version 1.4.0 in
pyproject.toml,code_cleaner/__init__.pyandCITATION.cff; the install and
GitHub Action examples pinv1.4.0.
Get started: Using SCRAWL with Code Cleaner. To run SCRAWL programs, install rosetta from the SCRAWL v1.4.0 release (prebuilt binaries) or with cargo install --git https://github.com/ZodiacDog/SCRAWL-v1.1 --tag v1.4.0 --bin rosetta.
pip install "git+https://github.com/ZodiacDog/Code-Cleaner@v1.4.0"Not published to PyPI.
SCRAWL created by M. L. McKnight / ML Innovations Research Lab. Contributor: Korg (AI assistant, Grok Bot).