Toolchain
Compiler and tooling reference
the active compiler and language server are written in Maylang; Rust/C provide the source-only bootstrap.
Build host: Linux x86-64 with Rust and GCC or Clang; Python 3 and binutils readelf are used by verification scripts.
Bootstrap from the repository root: sh compiler/rust/build.sh.
Compiler launcher: compiler/mayc/mayc_new; the launcher builds and caches the compiler on first use. Keep runtime/prelude/native sidecars and the runtime directory with the compiler.
Compile: compiler/mayc/mayc_new examples/hello.may -o /tmp/maylang-hello; run: /tmp/maylang-hello.
Default output removes a final .may suffix; other suffixes receive .out.
-h, --help — print command-line help and exit.
-V, --version — print the compiler identity/version.
--list-targets — list the supported target, its executable format and default runtime without a source file; the compiler host is Linux x86-64.
-o PATH, --output PATH — select output path.
--check — expand imports, parse, strictly check and resolve names without producing an executable. mayc check <source.may> is the subcommand form and takes the same options.
mayc run <source.may> [-- ARGS...] — compile to a private executable in $TMPDIR/mayc-run-<pid>/, run it with the remaining arguments after -- unchanged, and exit with the program's status; the temporary directory is removed afterwards. -o PATH keeps the executable at PATH instead. Compilation failures print diagnostics and never run a stale binary.
-O0, -O1, -O2 — optimization levels: -O0 disables the fat backend's optional passes (same as --no-opt), -O1 is the default and -O2 enables the accessor/helper inliner (same as --inline). Any other level is rejected.
--color auto|always|never (also --color=WHEN and --no-color) — color text diagnostics. auto is the default: color when stderr is a terminal and NO_COLOR is unset. --diagnostics json is unaffected.
--deps FILE — write a Make-style dependency file whose target is the produced binary (or the source with --check) and whose prerequisites are the entry file, every expanded import, the compiler and each runtime sidecar that was actually read. Paths are escaped for Make.
--strict — enable strict checking, the default.
--debug — instrument user functions with declaration/source frames; uncaught faults print a trace and caught errors expose err.stack.
--no-opt — disable the fat backend's optional passes (constant/variable forwarding, proven types, register homes, XMM Float temporaries, top-level bindings as main locals) for oracle tests; the program must behave identically.
--legacy — disable the strict pass for legacy untyped sources; name resolution and mutability checks still apply.
--inline — opt in to inlining small, straight-line, effect-free accessor and one-expression-helper functions into their call sites; off by default, and the default build is byte-identical without it.
--raw — omit runtime, native library and prelude.
--no-code-align — emit raw x86-64 code without the NOP padding that aligns function bodies and loop heads; for layout experiments.
--runtime full|none — select the runtime; full is the default and none is equivalent to --raw. --runtime core is not supported and is rejected.
--time — report compilation-stage timings to stderr.
--target TARGET — only x86_64-linux, the default, is accepted. x86_64-nodeos, arm64-linux, riscv64-linux, arm64-macos and x86_64-windows are not supported and fail with an error (why).
--dump-expanded — print import-expanded source and exit.
--stack-map-inventory — print the allocating-safepoint inventory (the call sites that can start a collection for precise stack maps) as JSON and exit; compile output is unchanged.
x86_64-linux — ELF64 with the full runtime or raw output.
mayc emits the machine code and executable container itself, with no assembler, linker, C compiler or LLVM. The experimental clang-llvm target and --emit-llvm were removed and now fail with an explanation.
Full runtime supports integers, boxed floats, UTF-8 strings, lists, maps, records, closures, structured errors, fibers and native C interfaces on Linux x86-64.
Diagnostics contain source excerpts and caret spans; text diagnostics carry a stable error[E_STAGE] code (lex, parse, type, name), and --diagnostics json reports the same code. Fix type/name/mutability errors before running the output.
Migrate an older source: python3 compiler/mayc/tools/migrate_strict.py old.may --write; review added Any types and explicit returns before relying on the result.
Language server implementation: Maylang maylsp; protocol/reference: LSP guide.
VS Code integration: extension installation and settings; strict checking defaults on through maylang.strict; rebuild server/reload the window after toolchain changes.
Workspace runner: may usage and may.json reference; may migrate converts an older mayproj.json project.
Compiler verification: make test-compiler; source-only chain and bootstrap fixpoint: make test-bootstrap.
Additional language/runtime regressions: python3 tests/compliance/run.py.
Networking verification: python3 compiler/mayc/tests/network.py; live tests may skip when socket creation is disallowed; CI can require sockets.
Documentation verification: python3 docs/reference/generate.py --check; this checks reference freshness, declaration description coverage and pure-list Markdown format.
More build/ABI/target details: compiler guide, native internals, GC guide, source bootstrap.
Runnable reference verification: python3 tests/docs/run.py; tagged-release provenance and publishing: installation.