Skip to content

Code Cleaner v1.4.0

Latest

Choose a tag to compare

@ZodiacDog ZodiacDog released this 05 Dec 00:08
· 29 commits to main since this release
a0a2389

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.py is 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 named consensus.vote and lex.call forms, 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 real rosetta binary 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_WATCH and the raw form compile; X_BRANCH else 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-target and scrawl-raw-form. scrawl-unreachable now follows jumps, so it also
      finds code that every branch skips, not only code after halt.
    • 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-item and scrawl-register-range
      (now compile errors: scrawl-bad-operand, scrawl-register-bounds).
    • New metrics: scrawl_instructions, scrawl_frame_bytes, scrawl_labels, scrawl_compiles,
      scrawl_compiler.
  • Optional rosetta integration (code_cleaner/languages/scrawl_toolchain.py). If SCRAWL's
    rosetta tool 1.4.0 or later is on PATH, analyze also runs
    rosetta check on 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: off turns it off.
  • code-cleaner scrawl commands: 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 if rosetta is missing) and toolchain.
    code-cleaner version shows 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 and docs/rules.md updated.
  • Examples: a starter program, examples/scrawl/hello.scrawl; countdown.rosetta (labels and a
    loop) and the canonical-vote consensus_round.rosetta from SCRAWL v1.4.0.
  • CI: a new scrawl-rosetta job installs rosetta two ways (the SCRAWL v1.4.0 prebuilt release
    binary, checked against SHA256SUMS, and cargo install from the tag) and runs the differential
    test, the examples on the VM and the scrawl commands.
  • Version 1.4.0 in pyproject.toml, code_cleaner/__init__.py and CITATION.cff; the install and
    GitHub Action examples pin v1.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).