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 task | Command | Result |
|---|---|---|
| Check a change before running it | ms check ms.toml | A status for the types, formatting and lint steps; --only types for the type check alone |
| Apply consistent layout | ms fmt ms.toml | Formatted files; silent on success |
| Check formatting in CI | ms fmt ms.toml --check | Names files needing changes; leaves source untouched |
| Check code, formatting, lint and tests together | ms check --test ms.toml | A status for each step; nonzero if a step fails |
| Profile a run | ms run --profile ms.toml | A bundle with folded stacks, a pprof profile and a top report |
| Find an API | ms search json | A bounded page of matching declarations |
| Understand a program visually | ms map ms.toml --format html -o code-map.html | An 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
msprints help.ms --versionprints the compiler version. - Command-line arguments must be valid UTF-8; invalid OS arguments return usage status 2.
- Long options take
--output pathor--output=path; only the first=splits, so--output=api=v1.mdwritesapi=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> --fixandms check --only lint <targets> --fixapply 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
--fixreturns 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#
ms run ms.toml --watch -- arg1
ms test test.ms --watchrunandtestrebuild 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> --watchandms check --only lint <targets> --watchrerun after each saved change and keep watching through errors and findings.--jsoncannot be combined with--watch.- Interrupting
msexits 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:
ms map ms.toml --format html -o code-map.htmlThe 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.

For a review, add a unified diff to highlight changed declarations and filter the map to changed code:
git diff --no-renames > change.patch
ms map ms.toml --format html --diff change.patch -o review.htmlThese 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#
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.mmdThese 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.
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--view | Shows |
|---|---|
overview | The 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) |
calls | Who is called; standard and built-in calls are leaves, which text and Mermaid join into one uses: line per caller |
effects | Callees that carry an effect, down to the standard function where each effect enters |
errors | Functions with a Result error type or try sites |
modules | Imports per module |
flow | One function’s ordered steps: calls, ?, branches, loops, match arms, resource scopes, exits (needs --entity) |
scope | flow pruned to resource scopes and the exits inside them (needs --entity) |
tasks | flow 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 |
world | What 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 IDfile#kind#nameroots the tree at one declaration (a project-relative path formodules). 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 samefile::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 nbounds expansion (default 3; 1 forflow,scope,tasksandownership). Repeats print(cycle). A view stops at 200 nodes and counts the rest.--diff <file|->reads a unified diff likems map --view reviewand marks changed entities with<- TIER #nor<- INTERNAL, and changed flow lines with<- changed. HTML includes the whole map.--format htmlincludes all views in one page and accepts--diff; omit--viewand--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.--jsonemits a versioned document withview,entityandtree(the default view iscalls).- Each tree node has
label,kind,reference(a stable entity ID or external call target when available),file,line,omittedandchildren. Source positions are one-based; line zero means no precise source position. The root’somittedcounts direct nodes skipped by the output cap. - Unless
--diffis given,typesandownershipprint ASCII class boxes and one signature line per function (add(var o Order, i Item) Order), not the generic tree.varmay change the argument; use JSON or Mermaid for the checked ownership modes. --format mermaidrenders a view for people:typesbecomes a class diagram with composition arrows, andownershipa flow colored by borrow mode (unless--diffis given).--jsonand--formatcannot be combined.
- Each tree node has
Review report#
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 1ms 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-renamesordiff -u);msdoes 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 anallow_effectline printspermits: + NAMEand ranks abovereaches: + 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.nis 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|markdownpicks the rendering (asciistill names text). Text tables show five rows per section unless--all;--jsonincludes every row and finding. Report format 2 includesbase_checked(nullfor a project map) and anumberon each finding (nullfor INTERNAL).--explain <n|id> --jsonemitsfinding, structuredcallers, and adiagramrequest withviewandentity, ornullwhen no current flow exists. Pass that entity ID directly toms 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):
| Tier | Text | Meaning |
|---|---|---|
CONTRACT | contract change | Exported signature or visibility change, exported entity added or removed |
CHECK | weaker check | A test or benchmark removed, now calling test.skip, or no longer calling an expectation such as test.expect_equal |
EFFECT+ | new effect | A newly reached declared effect, with the call path to where it enters |
ERROR | error handling | Different Result error type or number of ? sites |
RESOURCE | resources | Different number of resource scopes |
INTERNAL | lower risk | Body 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:
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 --jsonReplace 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.
| Command | Behavior |
|---|---|
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.tomlselects that project. - A directory without one recursively selects
.msfiles, skipping hidden,vendor, andnode_modulesdirectories, 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.tomlin 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. Selectms.tomlfor project-wide checking. - Use
--before filenames beginning with-.fmtkeeps 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.
checkandlintcontinue after an error and return 1 for any failed selection, source error, or lint error finding (any finding withlint --deny-warnings). Theirformat: 1JSON 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.
| Field | Meaning |
|---|---|
command, build_type | build or profile, and the native build level |
source_root, output | Source root and absolute executable or bundle destination |
completed, exit_code | Build success or normal process completion, and CLI status |
reason | Optional compile_error, build_error, artifact_error, execution_error, output_error, program_exit, or interrupted |
artifacts | Planned artifacts in stable order, each with kind, absolute path, and state |
stdout, stdout_base64 | Captured application text, or base64 for invalid UTF-8 (then stdout is empty) |
diagnostics | Source diagnostics or MSN001 operational errors; an array even when empty |
Artifact state values:
| State | Meaning |
|---|---|
verified | Builder or reference step succeeded |
written | New or changed file |
preserved | Unchanged existing file |
missing | Absent file |
unavailable | Path 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, orfault, chosen by the runtime entry point that raised it. An absentMapkey reportsfaultwithmap key not found: <key>.message, which carries the offending values.positionandtrace(function,file,line, innermost first,repeatedwhen frames collapsed), andtrace_truncated.cleanups_ran(the runtime runs every cleanup before it reports),cleanup_faults, andexit_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.
--jsonwritestarget,ok, and astepsarray in that order. Each step hasname,status(passed,failed,skipped),exit_code,duration_ns, andresult, the command’s own--jsondocument unchanged. A step that cannot produce one carrieserror; a skipped step carriesreason.lintandtestare skipped whentypesfails;fmtalways 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:
| Field | Meaning |
|---|---|
source_root | Root for module-relative diagnostic paths and test names |
tests | Planned tests in execution order, each with index, name, status, duration_ns, and optional failure text with its first source position |
summary | available declaration count; selected, passed, failed, skipped, not_run counts; total duration_ns |
completed | Whether the runner finished its plan (also true for listing or fail-fast) |
exit_code | CLI exit status |
stdout | Complete captured native stdout |
stdout_base64 | Replaces stdout (then empty) when bytes are not valid UTF-8 |
diagnostics | Compile diagnostics, or execution, build, or report errors; empty on ordinary runs |
fixture_errors | Optional file-level lifecycle failures with file, phase, failure, optional position |
reason | Optional fixture_error, fixture_abandoned, cancelled, listed, fail_fast, no_tests, no_match, compile_error, build_error, execution_error, or argument_error |
- Test
statusispassed,failed, orskipped. Listing setslisted: trueand leaves selected testsnot_run; fail-fast leaves the restnot_run. Optionalrepeatandshuffle_seeddescribe order. - If the process stops early, the active test is
incompleteand later ones arenot_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 withcompleted: false.MST001marks 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.enabledtoonoroffUnlessPressedunder[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.
| Code | Severity | Finding |
|---|---|---|
| MSL001 | warning | Trailing whitespace |
| MSL002 | warning | Missing final newline |
| MSL102 | warning | Unused import |
| MSL103 | warning | Unreachable statement |
| MSL106 | error | Capitalized match payload name that creates a fresh binding instead of matching a case. Use a helper or rename. See payload patterns |
| MSL107 | error | match nested inside another match, including inline callbacks. Use an early-exit binding, a trailing ?, or a helper. See flat match flow |
| MSL108 | warning | match on an Optional with only a payload arm and null; narrow with if x != null or x or fallback |
| MSL109 | warning | match on a Result with only ok and error arms; use a trailing ?, if v := x, or a Result method |
| MSL110 | warning | Unchecked .get() without a default; narrow with if x != null or x or fallback for Optionals, or ? / get_or for Results. See Optionals |
| MSL111 | error | while 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 |
| MSL112 | error | A 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 |
| MSL114 | error | A 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 |
| MSL115 | warning | A 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 |
| MSL116 | warning | A 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 |
| MSL117 | warning | An 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\} |
| MSL118 | error | A 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 |
| MSL120 | error | map.get(key).get_or(default) on a map. Write map.get_or(key, default). ms check --only lint --fix rewrites it |
| MSL121 | error | var 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 |
| MSL122 | error | var 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 |
| MSL123 | warning | for i in 0..xs.length() { ... } where the body only reads xs[i]. Write for item in xs { ... } |
| MSL124 | warning | A fresh list or total filled by a loop whose body is one append or +=. Write map, filter or sum |
| MSL125 | warning | for x in xs { out.append(x) } (or x.clone()). Write out.extend(xs) |
| MSL126 | error | x := e directly followed by return x. Write return e |
| MSL127 | error | m[k.clone()] = m.get(k).get() - v. Write m[k] -= v |
| MSL128 | error | A 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 |
| MSL129 | error | A statement result.get_or(null) on a Void!. Write void result. ms check --only lint --fix rewrites it |
| MSL130 | warning | A 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 |
| MSL131 | warning | print(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() { ... } |
| MSL132 | warning | xs.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 |
| MSL133 | warning | mid := (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 |
| MSL134 | warning | ys := 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 |
| MSL135 | warning | bytes.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.
ms run --profile main.ms --out-dir samples --top 10