Manuscript Documentation
v2026.12.0

Commands and editor setup#

Install an ms binary from Manuscript Releases , or build it from source . One binary covers formatting, lint, editor support, code maps, builds and profiling. See build setup and profiling for the tools each task uses.

Choose the next command#

Run project commands from the directory containing ms.toml. For a single-file tool, replace ms.toml with its .ms filename.

Your taskCommandResult
Check a change before running itms check ms.tomlA status for the types, formatting and lint steps; --only types for the type check alone
Apply consistent layoutms fmt ms.tomlFormatted files; silent on success
Check formatting in CIms fmt ms.toml --checkNames files needing changes; leaves source untouched
Check code, formatting, lint and tests togetherms check --test ms.tomlA status for each step; nonzero if a step fails
Profile a runms run --profile ms.tomlA bundle with folded stacks, a pprof profile and a top report
Find an APIms search jsonA bounded page of matching declarations
Understand a program visuallyms map ms.toml --format html -o code-map.htmlAn offline HTML file with checked source relationships

For a complete example with its output, start with the first-program workflow . The sections below explain command options and the structured results that automation reads.

  • Bare ms prints help. ms --version prints the compiler version.
  • Command-line arguments must be valid UTF-8; invalid OS arguments return usage status 2.
  • Long options take --output path or --output=path; only the first = splits, so --output=api=v1.md writes api=v1.md. Required values cannot be empty.
  • Arguments after -- are forwarded to the application unchanged.
  • Commands taking one source input also accept a project directory with ms.toml. Native commands select one application entrypoint.
  • ms check --only types <targets> --fix and ms check --only lint <targets> --fix apply available machine-applicable diagnostic fixes in place, then report what remains. They skip overlapping edits and cannot be combined with --watch. See the diagnostic fix contract for the supported repairs and JSON fields.
  • A failed source read or write while applying --fix returns status 1 and appears in the diagnostics, including --json. Independent writable files are still fixed and rechecked.
  • Final stdout handling reports failed writes or flushes with status 1 when the command would otherwise succeed. It preserves existing nonzero statuses and does not add a failure for a broken pipe.

Rebuild on save#

sh
ms run ms.toml --watch -- arg1
ms test test.ms --watch
  • run and test rebuild after each saved change to the manifest or a loaded local module, then restart. The old program gets an interrupt and five seconds for cleanup, and is stopped only after its replacement builds. A failed edit prints diagnostics and keeps watching.
  • ms check --only types <targets> --watch and ms check --only lint <targets> --watch rerun after each saved change and keep watching through errors and findings. --json cannot be combined with --watch.
  • Interrupting ms exits with status 130. See cache boundaries for what a rebuild still compiles.

Project lint covers every reachable local module. Library projects include all source modules and discovered tests.

Interactive code map#

Create a map of your project and open the resulting file in a browser:

sh
ms map ms.toml --format html -o code-map.html

The command succeeds silently and writes code-map.html. The single HTML file includes the source and works offline. Start at a module or function, follow callers and callees, and click source identifiers to see their checked types. Switch between four tabs, each opening with one sentence saying what it shows: Overview (how files call each other, in one band per folder, or who calls a picked function and what it calls), Call order (a sequence diagram whose line numbers jump to the source), Data (types with their fields and methods) and Outside world (which functions touch files, the network, other programs, the terminal or the clock). Function signatures show parameter borrow modes and returned values, connecting ownership to the code you are reading.

The code map’s Overview of run_command: run calls it, and it calls arity, place_order, quantity, report and valid_sku, with changed functions outlined The code map’s Overview of run_command: run calls it, and it calls arity, place_order, quantity, report and valid_sku, with changed functions outlined
Overview of a function with a diff overlay.

For a review, add a unified diff to highlight changed declarations and filter the map to changed code:

sh
git diff --no-renames > change.patch
ms map ms.toml --format html --diff change.patch -o review.html

These commands write change.patch and review.html without terminal output. The source panel beside a change shows its added lines in green and removed lines in red, in place. Boxes take the colour of their most serious change, and the “Look here first” list has a tick per change and a reviewed count, kept in that browser. J and K move between changes and X marks one reviewed. Run them in a working tree that matches the diff’s after state. The map shows relationships and control flow from the checked source; the call order view is static, not runtime traces. Use profiling to observe a running program and tests to check its outcomes.

Source inspection#

sh
ms check --only types ms.toml --json
ms map --view inspect ms.toml -o inspection.json
ms build --emit mir ms.toml -o main.mir
ms map ms.toml
ms map ms.toml --format mermaid -o calls.mmd

These need no linker. build --emit checks and lowers the program, then prints MIR (or the LLVM IR with --emit ir); it does not emit an executable. map --view inspect keeps symbols, local names, call sites, source hashes, statement spans, and declared effects. map presents checked program relationships as ASCII (default), Mermaid, or an interactive HTML code map . map --view review and the call graph views describe project declarations; standard-library calls remain boundary leaves and imports remain visible dependencies.

sh
ms map ms.toml --view effects --entity save
ms map ms.toml --view errors
ms map ms.toml --view tasks --entity load
ms map ms.toml --view overview
ms map ms.toml --view modules
ms map ms.toml --view types
ms map ms.toml --view ownership --entity save
ms map ms.toml --view flow --entity main --depth 2
ms map ms.toml --view scope --entity save
ms map ms.toml --view flow --entity save --diff change.patch
--viewShows
overviewThe system level: each module with its function and type counts, [entry] for main, the effects it reaches, and call counts to other modules (--format mermaid colors entry, pure and effectful modules)
callsWho is called; standard and built-in calls are leaves, which text and Mermaid join into one uses: line per caller
effectsCallees that carry an effect, down to the standard function where each effect enters
errorsFunctions with a Result error type or try sites
modulesImports per module
flowOne function’s ordered steps: calls, ?, branches, loops, match arms, resource scopes, exits (needs --entity)
scopeflow pruned to resource scopes and the exits inside them (needs --entity)
tasksflow pruned to resource scopes that start tasks: each promise(() => ...) with the calls its work makes (needs --entity)
types (alias class)Types, alternatives and interfaces, each field or case expanding to the project types it holds; a function as --entity expands its parameters and result the same way
worldWhat the program does outside itself, grouped as files, network, other programs, terminal, environment, clock, randomness and host, with the functions that do each thing by calling the standard library themselves; --entity limits it to what one function reaches
ownership (alias mutability)Per function: checked copy, borrow, move, or var (exclusive borrow) parameters; owned, borrowed, or owned-view results, including borrowed Result cases; closed resource scopes. Callees expand to --depth. Without --entity, functions with var parameters or resource scopes
  • --entity name, file::name, or a full entity ID file#kind#name roots the tree at one declaration (a project-relative path for modules). An exact entity ID takes precedence over declaration names and qualified names. A missing or ambiguous name fails with a selection remedy. A type and its methods share the same file::name; use the distinct IDs offered by the diagnostic, such as --entity 'src/main.ms#type#Box' and --entity 'src/main.ms#impl#Box'. Without --entity, roots are entities nothing relevant calls, plus roots for otherwise unreachable recursive groups. Tests are entry points too.
  • --depth n bounds expansion (default 3; 1 for flow, scope, tasks and ownership). Repeats print (cycle). A view stops at 200 nodes and counts the rest.
  • --diff <file|-> reads a unified diff like ms map --view review and marks changed entities with <- TIER #n or <- INTERNAL, and changed flow lines with <- changed. HTML includes the whole map.
  • --format html includes all views in one page and accepts --diff; omit --view and --entity. Type hints are capped at 200,000 identifiers. Individual views bound their display (about 40 overview nodes, 60 call nodes and 14 sequence lifelines); the map shows omitted counts and lets you navigate to a different part of the program.
  • --json emits a versioned document with view, entity and tree (the default view is calls).
    • Each tree node has label, kind, reference (a stable entity ID or external call target when available), file, line, omitted and children. Source positions are one-based; line zero means no precise source position. The root’s omitted counts direct nodes skipped by the output cap.
    • Unless --diff is given, types and ownership print ASCII class boxes and one signature line per function (add(var o Order, i Item) Order), not the generic tree. var may change the argument; use JSON or Mermaid for the checked ownership modes.
    • --format mermaid renders a view for people: types becomes a class diagram with composition arrows, and ownership a flow colored by borrow mode (unless --diff is given). --json and --format cannot be combined.

Review report#

sh
ms map --view review ms.toml
git diff --no-renames main... | ms map --view review ms.toml --diff -
ms map --view review ms.toml --diff change.patch --format markdown
ms map --view review ms.toml --diff change.patch --explain 1

ms map --view review prints where a reader should look. Every line is a fixed template filled with facts from the checked program, so equal inputs print equal bytes (no timestamps, absolute paths, or width dependence). Text output is written for people: a review of a change lists each finding with a sentence per change (a changed signature shows was and now lines; a new effect is said in words with where it enters, Can now print (std.console.write) through read_text) and how many functions call it, and the project map prints its sections as tables, naming empty ones on one line. --json keeps every section, including SUMMARY, in its fixed order.

  • Without --diff: the project map of public surface, entry points with effects, error types in signatures, resource scopes, and imports.
  • With --diff: compares the checked program before and after. Pass a unified diff from a file or stdin (git diff --no-renames or diff -u); ms does not run git. The working tree must be the diff’s after state. A diff that does not match is rejected with status 2. Renames are unsupported.
  • --effect <name|pattern> (with --diff) keeps only findings that newly reach or newly permit a matching effect (std.net.*, *.write). A finding that adds an allow_effect line prints permits: + NAME and ranks above reaches: + NAME, because a widened permission lets later code reach more without another review row.
  • --explain <n|id> (with --diff) prints one finding: id, tier, location, score terms, evidence, direct callers, and the diagram command for its flow. n is the number under Look here first; a full id or unambiguous entity name also works. Removed entities and declarations without a callable body have no current flow.
  • --format text|markdown picks the rendering (ascii still names text). Text tables show five rows per section unless --all; --json includes every row and finding. Report format 2 includes base_checked (null for a project map) and a number on each finding (null for INTERNAL).
  • --explain <n|id> --json emits finding, structured callers, and a diagram request with view and entity, or null when no current flow exists. Pass that entity ID directly to ms map --entity.
  • If the before state does not check, the report says so and lists only touched entities. If the current tree fails checking, it prints diagnostics and exits 1.

Entities match by file, kind, and name, so formatting and in-file moves are not changes. Tiers (JSON name, then the words text uses):

TierTextMeaning
CONTRACTcontract changeExported signature or visibility change, exported entity added or removed
CHECKweaker checkA test or benchmark removed, now calling test.skip, or no longer calling an expectation such as test.expect_equal
EFFECT+new effectA newly reached declared effect, with the call path to where it enters
ERRORerror handlingDifferent Result error type or number of ? sites
RESOURCEresourcesDifferent number of resource scopes
INTERNALlower riskBody changed without affecting any tier, or an effect the function caused itself is no longer reached (“Can no longer print.”)

A change whose only difference is a new effect that enters through another changed function is listed under that function (“Its callers gain it too: grade (4), …”), keeping its number for --explain. Text and HTML reports open with an “In short:” line counting contract changes, functions that can now fail, and functions that can now cause each new effect.

Reach is the number of entities that transitively call the changed one; the score is the sum of the listed terms. Only newly reached declared effects rank.

The report compares tracked static properties; it does not run tests. An INTERNAL body edit can still change runtime behavior. “No tracked semantic changes” means the comparison found no changes to those properties.

For an agent, follow a finding’s stable ID through the same workflow:

sh
ms map --view review ms.toml --diff change.patch --json
ms map --view review ms.toml --diff change.patch --explain 1 --json
ms map ms.toml --view flow --entity 'src/main.ms#fn#save' --diff change.patch --json

Replace the example ID with diagram.entity from the explanation. Each command needs the diff again, so save a piped diff to a file before following up.

Commands for agents#

These commands answer questions the compiler commands do not, and print only what you need to act.

CommandBehavior
ms search [<name or words>... | <path>]Fuzzy, case-insensitive lookup over project and standard-library symbols (--limit n, default 5, max 10 total matches; --json). Project matches come first and print file:line:column, type, description, and up to five uses; standard matches fill remaining places and print signature and path. A lone module or declaration path (json, prelude.List, prelude.List.sorted) prints that page, capped near 3.5 KB; no argument lists modules
ms help <code...> [--json]Explain diagnostic families, severity and usual repairs

Pair them with ms check, ms fmt --check, ms check --only lint, and ms test, which print compact diagnostics (--json for complete documents).

Selecting independent analysis inputs#

ms check --only types and --only lint accept multiple .ms files, directories, and ms.toml projects. ms check --only types src utilities.ms --json checks each input independently; declarations are not combined and no main or test runs. Native commands take one entrypoint.

  • A directory with ms.toml selects that project.
  • A directory without one recursively selects .ms files, skipping hidden, vendor, and node_modules directories, directory symlinks, and nested projects. Select nested projects explicitly; explicitly selecting an excluded path is allowed. File symlinks must stay inside the directory.
  • Standalone directory discovery requires UTF-8 source filenames and visited directory names; invalid names are selection errors.
  • A file target uses the nearest ms.toml in its directory or an ancestor as its import root and alias source, so entry files can share a library above them (../lib.ms); the file stays the only entry and nothing else in the project is checked. Without one, the file’s own directory is the root. Select ms.toml for project-wide checking.
  • Use -- before filenames beginning with -. fmt keeps its own directory and manifest discovery .

Targets, imported diagnostics, and documented modules are deduplicated and ordered by displayed path and position. Paths inside the invocation directory are relative; others are canonical absolute paths.

  • check and lint continue after an error and return 1 for any failed selection, source error, or lint error finding (any finding with lint --deny-warnings). Their format: 1 JSON collects all diagnostics. Empty selections succeed with empty arrays. Usage errors return 2.

Machine-readable native results#

ms build <input> --json and ms run --profile <input> --json write one format: 1 document to stdout. Usage errors return 2 on stderr with no JSON. Stderr stays stderr; profile captures application stdout untruncated.

FieldMeaning
command, build_typebuild or profile, and the native build level
source_root, outputSource root and absolute executable or bundle destination
completed, exit_codeBuild success or normal process completion, and CLI status
reasonOptional compile_error, build_error, artifact_error, execution_error, output_error, program_exit, or interrupted
artifactsPlanned artifacts in stable order, each with kind, absolute path, and state
stdout, stdout_base64Captured application text, or base64 for invalid UTF-8 (then stdout is empty)
diagnosticsSource diagnostics or MSN001 operational errors; an array even when empty

Artifact state values:

StateMeaning
verifiedBuilder or reference step succeeded
writtenNew or changed file
preservedUnchanged existing file
missingAbsent file
unavailablePath cannot be read as a regular file

A failed check preserves prior files and creates no capture directory. Only a completed build establishes a valid executable and metadata pair; a partial result identifies any partial output.

A nonzero application exit keeps its status with completed: true and reason: "program_exit". A signal-terminated process has completed: false and reason: "interrupted". Arguments after -- pass unchanged, and profiles still require a new directory.

Machine-readable checks and tests#

ms fmt <targets> --check --json, ms test <input> --json, and ms run <input> --json write one format: 1 document to stdout. Usage errors return 2 on stderr with no JSON. fmt --json requires --check; test --json --watch is rejected.

ms run --json captures the program’s output and reports exit_code, stdout, stderr and diagnostics. Compile errors return reason: "compile_error" with diagnostics. It returns the program’s own exit status.

A program that ends in a runtime fault (exit status 134, or 139 for stack_overflow and out_of_memory) adds a fault object. ms test --json adds the same object to a test that faulted. Its fields:

  • kind: division_by_zero, overflow, index_out_of_range, stack_overflow, out_of_memory, deadlock, incomplete_cleanup, or fault, chosen by the runtime entry point that raised it. An absent Map key reports fault with map key not found: <key>.
  • message, which carries the offending values.
  • position and trace (function, file, line, innermost first, repeated when frames collapsed), and trace_truncated.
  • cleanups_ran (the runtime runs every cleanup before it reports), cleanup_faults, and exit_code.

ms check [target] [--json] [--test] [--deny-warnings] with no --only runs the type check, fmt --check and the lint rules, and with --test the tests, on one target (default ms.toml) and exits 1 when any step fails. Lint warnings do not fail the lint step unless --deny-warnings is passed. --only types, --only lint or --only fmt runs one step with that step’s own options (--fix, --watch, --std, several inputs) and its own output.

  • --json writes target, ok, and a steps array in that order. Each step has name, status (passed, failed, skipped), exit_code, duration_ns, and result, the command’s own --json document unchanged. A step that cannot produce one carries error; a skipped step carries reason.
  • lint and test are skipped when types fails; fmt always runs; the native test build runs only with --test.
  • Without --json, each failed step prints its first eight findings to stderr.

ms map (every view) accepts --json for check failures: unchecked source writes the check --json diagnostics document and exits 1. Successful call graph and review JSON use the schemas described above.

Formatting results contain files and diagnostics, both arrays even when empty. Each file has path and status: clean, needs_formatting, or error. Files are deduplicated and ordered by displayed path. Drift is MSF001; selection and I/O errors are MSF002; parse and manifest diagnostics keep their codes. The command writes no source, returns 1 on any drift or error, and still reports other files. An empty selection succeeds.

Test results:

FieldMeaning
source_rootRoot for module-relative diagnostic paths and test names
testsPlanned tests in execution order, each with index, name, status, duration_ns, and optional failure text with its first source position
summaryavailable declaration count; selected, passed, failed, skipped, not_run counts; total duration_ns
completedWhether the runner finished its plan (also true for listing or fail-fast)
exit_codeCLI exit status
stdoutComplete captured native stdout
stdout_base64Replaces stdout (then empty) when bytes are not valid UTF-8
diagnosticsCompile diagnostics, or execution, build, or report errors; empty on ordinary runs
fixture_errorsOptional file-level lifecycle failures with file, phase, failure, optional position
reasonOptional fixture_error, fixture_abandoned, cancelled, listed, fail_fast, no_tests, no_match, compile_error, build_error, execution_error, or argument_error
  • Test status is passed, failed, or skipped. Listing sets listed: true and leaves selected tests not_run; fail-fast leaves the rest not_run. Optional repeat and shuffle_seed describe order.
  • If the process stops early, the active test is incomplete and later ones are not_run.
  • Outcomes come from a separate result channel, so test output that looks like RUN/PASS/FAIL creates none. Stderr never enters the JSON.
  • No test blocks: exit 0, reason: "no_tests". Unmatched filter: exit 1, reason: "no_match". Test failures exit 1; abrupt native exits keep their status with completed: false. MST001 marks non-source execution, build, or report failures.

Editor features#

Install the Manuscript VS Code extension , then open your project folder. Put ms on PATH or set manuscript.serverPath to your compiler executable. After changing that setting, run Manuscript: Restart language server. The extension starts ms lsp for you; it is a protocol server, not an interactive terminal command. Other LSP clients can launch the same command over standard input/output.

Open a .ms file, hover over a name to see its type, use Go to Definition to follow it, and apply a diagnostic’s quick fix when offered. Formatting uses the same rules as ms fmt, keeping editor and command-line edits consistent.

The language server provides incremental sync with validated UTF-16 ranges, diagnostics and lint codes, document and workspace symbols, semantic tokens, folding, inferred-local type hints, hover, definition and type-definition navigation, highlights, references, signature help, formatting, import organization, code actions, and rename.

  • Completion follows the checker’s lexical scope and member rules: visible parameters and locals, generic-bound operations, fields, collection and service methods, variant cases, named arguments, snippets (if the client supports them), standard and project auto-imports, and import paths. Used arguments, inaccessible opaque fields, and sibling-scope locals are excluded. An accepted auto-import adds an ordinary import.
  • Completion keeps working while code is incomplete; checking, formatting, and builds never accept repaired source.
  • References and rename cover declarations, uses, assignments, type annotations, imports, parameter labels, fields and constructors, and interface operations, including unopened modules. Rename checks the proposed snapshot, rejects identifiers that could capture, and cannot rename external declarations or malformed source.
  • Standard-library definitions open read-only in VS Code with hover and navigation.
  • VS Code hides inline type hints by default; hover still shows types. Set editor.inlayHints.enabled to on or offUnlessPressed under [manuscript] to show hints.

Linting and formatting#

Each lint rule is a warning or an error. ms check --only lint returns 1 when a source file fails checking or has an error finding, and 0 otherwise: warnings are printed (with a count) but do not fail the command. --deny-warnings makes warnings fail too, for CI. --json findings carry severity (warning or error); the language server reports warnings and errors with the matching LSP severity. ms help <code> prints a rule’s severity. Run ms check --only types for correctness errors.

CodeSeverityFinding
MSL001warningTrailing whitespace
MSL002warningMissing final newline
MSL102warningUnused import
MSL103warningUnreachable statement
MSL106errorCapitalized match payload name that creates a fresh binding instead of matching a case. Use a helper or rename. See payload patterns
MSL107errormatch nested inside another match, including inline callbacks. Use an early-exit binding, a trailing ?, or a helper. See flat match flow
MSL108warningmatch on an Optional with only a payload arm and null; narrow with if x != null or x or fallback
MSL109warningmatch on a Result with only ok and error arms; use a trailing ?, if v := x, or a Result method
MSL110warningUnchecked .get() without a default; narrow with if x != null or x or fallback for Optionals, or ? / get_or for Results. See Optionals
MSL111errorwhile true loop in a module that imports @std/concurrency/promise.ms whose body neither waits nor exits; other promises cannot run and cancellation or a timeout cannot stop it. See loops
MSL112errorA function that calls itself on every path: no return, ?, or fault leaves it before the recursive call, so it cannot finish. Add a base case. Only direct self-calls of module-level functions are found
MSL114errorA resource closed when its scope ends whose type has a zero-argument flush or commit returning a Result that nothing calls. Call the separate fallible operation, such as x.flush()?, before the scope ends so its result is handled. See scopes
MSL115warningA promise dropped as soon as it is made, which cancels its work. Bind it and call wait(), or pass it to wait_all. ms check --only lint --fix appends .wait() where appropriate
MSL116warningA function reaches an effect no // ms: allow_effect line permits. A function is pure unless a line above it, or in the file’s header comment, permits what it reaches (std.fs.read, std.fs.*, *.read, *). A function’s own lines can only tighten the header. // ms: effect NAME declares an effect and hides the body from callers. main, test and fixture are unrestricted. Converting a record to an interface, naming a function as a value and writing a closure charge the enclosing function. The message names the call path
MSL117warningAn integer literal interpolated into text, such as the {4} of f"\\d{4}", which interpolates the number 4 instead of writing a regex quantifier. Drop the f so braces are plain, or write \{4\}
MSL118errorA length() of a string, list, map or set compared with zero, such as xs.length() == 0. Write xs.is_empty(), or not xs.is_empty() for != 0 and > 0 in a condition. ms check --only lint --fix rewrites it
MSL120errormap.get(key).get_or(default) on a map. Write map.get_or(key, default). ms check --only lint --fix rewrites it
MSL121errorvar x = a followed by if c { x = b }, where a is a literal or name and c does not read x. Write x := if c { b } else { a }. ms check --only lint --fix rewrites it
MSL122errorvar i = 0 and while i < n { ... } whose last statement is i += 1, with i unused afterwards and no continue. Write for i in 0..n { ... }. ms check --only lint --fix rewrites it
MSL123warningfor i in 0..xs.length() { ... } where the body only reads xs[i]. Write for item in xs { ... }
MSL124warningA fresh list or total filled by a loop whose body is one append or +=. Write map, filter or sum
MSL125warningfor x in xs { out.append(x) } (or x.clone()). Write out.extend(xs)
MSL126errorx := e directly followed by return x. Write return e
MSL127errorm[k.clone()] = m.get(k).get() - v. Write m[k] -= v
MSL128errorA final return ok() in a Void! function, or return in a Void one, after other statements. The end of the body already returns it; delete the line
MSL129errorA statement result.get_or(null) on a Void!. Write void result. ms check --only lint --fix rewrites it
MSL130warningA statement result.get() on a Result faults when the call fails. Write call()? where the function returns a Result (main can return Void!), or void call() to ignore the outcome
MSL131warningprint(call()) where the call returns a Result prints the wrapper (ok(2)), not the value. Write call()? in a function that returns a Result, or if value := call() { ... }
MSL132warningxs.slice(a, b).get_or(fallback) returns the fallback for any bad range, including an end past the length, with no error. Write xs.slice(a, b)?, or clamp the end with min(end, xs.length()) first
MSL133warningmid := (lo + hi) // 2 compiles as (lo + hi) because // starts a comment, so the number after it is ignored. Int / already truncates: write (lo + hi) / 2
MSL134warningys := xs.sort() binds Void and print(xs.reverse()) prints void: sort and reverse change the list in place and return nothing. Call them as statements, or use sorted() or reversed() for a new list
MSL135warningbytes.to_string() renders Bytes(104, 105), not the text: a WebSocket message, file or socket read holds bytes. Write ok_or(bytes.decode_utf8(), Error("not UTF-8", kind: "EBADMSG"))? for the text

Whitespace warnings exclude text-literal payloads. Whitespace deletion fixes are withheld while lexical boundaries are invalid or incomplete.

Implicit imports (such as List for list literals) count as uses. Unused-import and whitespace fixes are editor actions; initializers with possible effects are never silently removed.

ms fmt formats files, directories, and manifests (--check reports drift without rewriting, --drop-labels removes redundant call labels). See formatting for the complete formatter contract.

Debugging and profiling#

Native builds keep frame pointers and DWARF line tables, so faults report source frames and external tools such as perf can attribute samples; see profiling and native debugging .

ms run --profile <file.ms|ms.toml> --out-dir <new-directory> builds the application, runs it with the sampling profiler, and writes program, profile.folded, profile.pb (pprof), top.txt, and manifest.json. Existing directories are rejected. Profiling adds overhead, so measure an unprofiled executable when comparing speed.

sh
ms run --profile main.ms --out-dir samples --top 10