Skip to content

chore(#555): masc's command line on std.args - #561

Merged
octalide merged 3 commits into
devfrom
feat/555
Oct 31, 2026
Merged

octalide merged 3 commits into
devfrom
feat/555

Conversation

@octalide

@octalide octalide commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Closes #555

What

masc's command line moves onto std.args CommandSpec, on mink 6b8c86f (mink dev after #611) and std b05d073.

  • Pins: dep/mink and gen/dep/mink at 6b8c86f, with std b05d073, yaml 72b442c, deflate 9ac36c2 and zstd ce66726 as that mink pins them, in the root and in gen, and gen's json at 06e7b03.
  • Each command module under src/cli/cmds exports one SPEC: args.CommandSpec and its run. src/cli/masc.mach holds one command table (spec, whether it takes the sets' mode flags, run) and builds the CommandSet from it. The line is read with args.parse, refusals are worded by args.describe, pages are rendered by std.args.help, and dispatch finds the table row of the spec the invocation names. No argument parsing is left in src/cli or src/bin/masc.mach.
  • masc.tool.help is gone, replaced by std.args.help. render.MEANINGS becomes render.EXITS, the set's args.Exit rows.
  • New commands make the program reach the mirl-facing modules: listing (emit.listing over the builder), inline (inline.parse and inline.encode, operands resolved through emit.registers) and walk (walk.check). emit.emit is reached through registers and spell.
  • asm.read is split out of asm.assemble, so listing keeps the assembler's builder past finish to list it.

Decisions

  • The registered sets' mode flags are a table built when the line is read and joined after the tables of each command that takes them (assemble, listing), so the specs stay static data and a set's mode flag stays no edit to the CLI.
  • -a, -o, -v and -h are alias rows of --arch, --output, --verbose and --help, per std.args' one spelling per row. --help/-h are the set's common table, and --help in the command word's place is a global of the help command.
  • Usage refusals are rendered error[cli.line]: <args.describe's sentence>.
  • inline declares each operand with --operand <name>=<register> (collect): the register's class is its constraint, the register its location, its role read-write. The block is encoded at the start of the dialect's first section through the assembler's builder and written with -o.
  • walk takes --symbol <name> (placed, sized) and --secret <register> (collect), and reports clear, unguaranteed (with ct's warning), refused (worded by ct.spell) or unread, at the function offset.
  • Register names read without regard to case where the target syntax folds them.

Consumer changes

masc's own command line only. The commands and flags mirl and mach can call:

  • masc assemble <input> --arch <arch> -o <path> [--isa] [--syntax] [--abi] [--format] [-v] [mode flags]
  • masc disassemble <input> --arch <arch> [--isa] [--syntax] [--[no-]aliases] [-o] [-v]
  • masc listing <input> --arch <arch> [--isa] [--syntax] [--abi] [--format] [-o] [-v] [mode flags] (new)
  • masc inline <input> --arch <arch> -o <path> [--operand name=register]... [--isa] [--syntax] [--abi] [--format] [-v] (new)
  • masc walk <input> --arch <arch> --symbol <name> [--secret register]... [--isa] [--syntax] (new)
  • masc targets, masc help [command], --help/-h on every command

Library: masc.tool.help is removed (internal, not forwarded). asm.read is new (internal).

None of mink's consumer changes (link.command.parse, Command fields, --state) reach masc, which never called mink's link command. sink.writer and file.written carry the help page and the usage refusal into masc's text.

Notes

  • walk exposes no memory, frame or symbol seeds, declassify points, call models or fixup sites, so a symbol-addressed access is placed as any other and every call takes the conservative rule.
  • inline prints no footprint (inline.effects), since masc has no footprint renderer.
  • No tests, per the v7 rules.
  • Checks were host-only: machd check . -a '*' and machd build . -a masc on linux-x86_64 (the program artifact is masc, not cli), machd fmt ., and a smoke run of assemble, listing, inline, disassemble and walk on x86_64 elf.

…son at its manifests

mink 6b8c86f is mink dev after #611, on std b05d073 with std.args.
asm.read reads source into an assembler's builder, so a caller that lists the builder after finishing it keeps it. asm.assemble reads through it.
each command is one CommandSpec and its run in one table, the set made from it with the registered sets' mode flags joined to the commands that take them. help pages come from std.args.help, so masc.tool.help goes. listing, inline and walk are new commands, so the program reaches emit, listing, inline and walk.
@octalide
octalide marked this pull request as ready for review October 31, 2026 22:27
@octalide
octalide added this pull request to the merge queue Oct 31, 2026
Merged via the queue into dev with commit e5287d8 Oct 31, 2026
2 checks passed
@octalide
octalide deleted the feat/555 branch October 31, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

masc's command line on std.args

1 participant