xqcli 0.3.2

Unified CLI for the XQuad Toolchain
xqcli-0.3.2 is not a library.
Visit the last successful build: xqcli-0.0.0

xqcli

Unified CLI for the XQuad Toolchain.

This crate is named xqcli; it builds the xquad binary. That is: cargo install xqcli installs a command called xquad, not xqcli. Running xqcli --help after installing will fail because no such binary exists.

Install

cargo install xqcli
xquad --help

Subcommands

xquad has four subcommands, one per stage of the toolchain: asm, dism, run, verify.

Subcommand Does
xquad asm <INPUT> Assemble .xqasm source into .xqb bytecode
xquad dism [FILE] Disassemble bytecode into a human-readable listing
xquad run <FILE> Run bytecode (or assembly, with --text) on the interpreter
xquad verify <FILE> Run the bytecode verifier (all phases)

Run xquad <subcommand> --help for the full option list; the summaries below are the parts most people need first.

  • xquad asm: -o, --output <OUTPUT> (defaults to <input>.xqb), --stdout to write bytecode to stdout instead of a file.
  • xquad dism: reads from stdin when FILE is omitted.
  • xquad run: --text to treat FILE as assembly, --calldata <CALLDATA> (comma-separated integers), --outputs <OUTPUTS> (default 16), --step-limit <STEP_LIMIT> (default 10000000, 0 = unlimited), --trace with --trace-format text|json and --trace-file <FILE>.
  • xquad verify: --text to treat FILE as assembly before verifying.

Quick start

cat > add.xqasm <<'EOF'
; add.xqasm -- push two integers and add them
PUSH 10
PUSH 32
ADD
HALT
EOF

xquad asm add.xqasm -o add.xqb
xquad run add.xqb
xquad dism add.xqb
xquad verify add.xqb

xquad run add.xqb prints the residual stack:

stack (bottom to top):
  42

Links out

License

AGPL-3.0-or-later.