One binary does everything: compiling, linking, serving editors, cleaning up.
Every flag has a short and a long spelling (-c and --compile are the same
flag), values are case-insensitive where they name a choice, and flags that
take a list separate its items with commas. A flag that takes a list —
--source, --external-contract, --optimize and --quality — may also be
given more than once, in either spelling, and each occurrence adds its items
to the ones before it. Every other flag takes one value: giving it a second,
different value is refused by name, and the same value given twice stands.
the flag '--platform' takes one value and was given two, 'linux,amd64,utf-8' and 'linux,arm64,utf-8'; give it once, with the value meantA representative build:
mica --compile --link --optimize release,full_optimizations \
--platform linux,amd64,utf-8 \
--source Hello.mica --build buildModes
| Flag | Effect |
|---|---|
-c | --compile | compile source files to assembly |
-l | --link | link the compiled objects into the output program or library — requires --compile |
-r | --run | compile one source file and immediately execute it, like a script; --run - reads the source from standard input. With --platform naming the other architecture, the program starts under that architecture’s user-mode emulator, qemu-x86_64 or qemu-aarch64 from the qemu-user package, with the cross C library under /usr/<triple>; with --sanitize, it runs checked |
-lsp | --language-server | run as a language server over standard input and output; the former spelling --lsp stays accepted as an alias; the VS Code extension is the packaged client, and any LSP-capable editor can be pointed at the command |
-in | --inspect | print the manifest a linked program, archive or shared object carries, as one line of JSON, without starting it: among its members its own version and the libraries it was built against with theirs, the parts of the runtime floor a program was linked with or a library’s code reaches, and for a runtime floor the parts it carries, "floor":{"families":["tasking","tensor"]} for the full floor and [] for the light one, for a program or a shared object image, the memory the program image needs before it starts, and run_path, the folders it looks in for its shared libraries, and for a library contract, the contract it carries inside it |
-fm | --format | format Mica source files in place to the house layout and print each rewritten path; a directory formats every .mica file beneath it, and - reads standard input and writes standard output; combines only with --check |
-ck | --check | with --format: write nothing, print every path that is not formatted, and exit with 1 when one is not |
-p | --purge | empty the build directory first — requires --build, and may run without --compile |
-v | --version | print version information and exit |
-h | --help | print the flag summary and exit |
At least one of --compile or --purge must be present; everything else
qualifies them. --language-server stands alone: it claims standard output for the
protocol and prints no banner. --inspect stands alone too: it reads one program
file, prints its manifest and no banner, and refuses any other flag and any
further word. --format is a mode of its own: it combines only with --check,
and the paths it formats follow the flags, mica --format --check src; it
changes white space only, so every token, every comment and every line break
stays.
The run mode
mica --run tool.mica compiles
the file into a temporary directory at the debug tier — checks maximal,
latency milliseconds — executes it, forwards the program’s exit code as its
own, and removes the directory, an interrupted run included. Nothing is cached
and nothing lands beside your file. Two roads leave the directory behind: a run
killed outright, which has no chance to remove it, and an internal compiler
error, which keeps it because its message names the crash report written there,
mica-run-…/mica-crash-report.tar.gz in your temporary directory, as the file
to send; the directory is yours to remove once the report is sent.
mica --run tool.mica alpha beta # everything after the file belongs to the program
mica tool.mica alpha beta # the bare spelling means the same
mica --optimize O2 tool.mica # the run mode's flags may precede the file
mica --run --optimize O2 tool.mica # before or after --run
mica --run - << 'EOF' # a here-document is a program
program Hi; imp WriteLn : std; begin WriteLn("hi"); end.
EOFThe rules, each of which is the scripting convention:
- Arguments. Everything after the source file belongs to the program
(readable through the
processunit’sArgCountandArg); an optional--between file and arguments is accepted. Compiler flags come before the file: ahead of--runor between--runand the file, and before the file in the bare spelling. A word between--runand the file that starts with-and is no flag is refused by name. - Exit code. The program’s exit code is the process exit code — callers branch on it.
- Streams. The program owns standard output. The compiler is silent on success, keeps warnings, and speaks on standard error only.
- Shebang. A leading
#!line belongs to the operating system, and the compiler’s source preparation removes it on every road — the build, the editor, and the run mode all read the file identically, with line numbers preserved. The bare spelling makes#!/usr/bin/env micaa working first line —chmod +xand the file runs — and it also accepts an existing file with no extension, so a script installed under a command name stays a command. - Projects. The nearest
mica.projectup the directory tree contributes its encoding and contracts — a script beside your project imports your libraries with no flags — and the memory class, the tasking and the runtime profile it states where the run names none; when the file is one of the project’s own sources, the whole source set compiles with it. - Flags. The run mode owns compilation, linking, and the build directory;
it combines with
--optimize,--stdlib,--memory-class,--tasking,--runtime-profile,--processes,--runtime-flags,--platform,--sanitize,--stack-size, and--remarks, and refuses everything else with one line. Everything after the file is the program’s; a runtime-flag group at the head of it reaches the program’s runtime. It targets the host architecture; cross builds go through--compile.
Inputs and outputs
| Flag | Value | Effect |
|---|---|---|
-s | --source | file.mica,file.mica,… | the source files of the build, comma-separated |
-pj | --project | path to mica.project or its directory | read the compilation’s facts — sources, encoding, consumed contracts, version — from a project file; every explicit flag overrides its entry |
-b | --build | directory | where every generated file lands; the linked binary is named after the first source file’s program or library |
-sl | --stdlib | path to an archive | name a standard library explicitly; when omitted, the compiler resolves mica-stdlib-<arch>.a next to its own executable first, then under /usr/lib/ |
-xc | --external-contract | one or more paths to mica.external, its directory, or a library’s archive or shared object, comma-separated | consume external libraries’ interop contracts from explicit locations instead of the source-directory lookup; several paths let one program import several separately built libraries, each through its own contract, and a repeated --external-contract adds its paths to the ones before it, as the comma-separated form does; a library binary is read through the contract inside it |
The build directory. --build names the directory every generated file lands
in, and the build creates it where it is missing. The current directory and the
root directory are never one: --build . and --build / both write into
build beneath the current directory, so the generated files never land among
your sources.
mica --compile --link --source Hello.mica --build .
./build/HelloThe project file. A mica.project beside the sources states what belongs to the
source tree rather than to any one invocation:
{
"sources": ["Consumer.mica"],
"encoding": "utf-8",
"contracts": ["../build/Utilities", "../build/LibB"],
"version": "1.4.0",
"requires": {"Utilities": "2.0"}
}--project reads it, explicit flags override its entries one by one, and a
--platform that names no encoding — linux,arm64 — completes its encoding
from the file. The version has no flag: it is the program’s or library’s own,
written as Semantic Versioning writes one. A library is
linked only under a version, so a library’s build names its project file, and a
build that reads a project file reads the version it states. requires
states which versions of each library the build accepts, "2.0" every
version from 2.0.0 up to 3.0.0, and a library outside its requirement
refuses the build by name. A library’s
build carries its version into the contract it emits, and every program built against
the library names it in its build, Using library 'Utilities' 2.0.0, and in
its manifest. The language server discovers the project on its own by walking
up from the open file, so the editor analyzes each source under the same
sources, encoding, and contracts the build uses, with no configuration.
The file is ignored by compilers older than 6.12.5.
Naming a standard library explicitly is also a statement of trust: a
mica-stdlib-<encoding>.external contract beside the named archive is used as
that library’s import surface. An auto-resolved standard library uses only the
surface embedded in the compiler binary — no file on disk changes what an
installed compiler believes.
One standard library serves every memory class, tasking flavor and runtime
profile: those select the runtime floor beneath it, so a named library
contradicts none of them.
What a link does refuse is a standard library or a floor that another compiler
built. Each archive names the release and the commit of the compiler that built
it, and the refusal names both compilers, or says that the archive names none,
because code from one release and a floor from another meet only by name.
What is built
| Flag | Values | Effect |
|---|---|---|
-om | --output-modifier | none · archive · object | the library output kind: archive produces a static library (.a), object a shared object (.so), none (default) an executable program — requires --link. A shared object names the shared runtime floor the mica-dragon-rt package installs beside the archives, libmica-dragon-rt-<arch>.so.<release> or one of its variants, instead of carrying a copy, so every Mica shared object a process loads runs on one floor with one scheduler and one carrier pool; the floor stays loaded once a process has loaded it, and a second floor, which a library built by another release, at another tier or with another tasking flavor or memory class would bring, is refused by name as it loads. A library that exports a task, or places work on processes, links as an archive: a program starts a task at the address of its entry, which a position-independent program cannot take from a shared object, and no program starts a process server for the floor beneath a shared object |
-ext | --external | static · shared | which link profile of each library’s contract the link reads, the way a C library that comes as an archive and as a shared object is linked; the default is static, which needs no rpath and ships as one artifact. A Mica library’s contract names the one file its build made under both — requires --link |
-ec | --emit-contract | when linking a library, emit its interop contract (mica.external) beside the archive as well; the archive or shared object carries the same contract inside it with or without the flag, wherever a contract can carry the library’s surface (a generic instance or a fixed array written in place in an exported heading leaves the file without one; see Known limitations) — requires --link | |
-eh | --emit-header | when linking a library, write its C header <Library>.h beside the archive or shared object, from the same facts as its contract: the string descriptor, every exported record, enumeration, subrange and array type, one macro per exported constant, one declaration per exported routine under its linkage name for the build’s encoding, and the entry that runs the library’s body; an export C cannot express, such as a fixed array passed by value, a task or a generic routine, is left out, and the header’s opening comment and a note of the build name it with its reason; a program’s link writes no header. C calls Mica walks one — requires --link | |
-slu | --standard-library-unit | the standard library’s own build flag, refused for every program and by --run | |
-np | --no-pie | disable position-independent-executable output — requires --link | |
-nrp | --no-run-path | write none of the build’s run path into the linked program or shared library, for a package that installs its libraries into the system’s library folders, except one folder: a program over a Mica shared library whose runtime floor is an installed variant other than the plain one (a debug, multicore, fixed-arena or sanitized build) keeps that variant’s folder under /usr/lib, such as /usr/lib/mica-dragon-rt-sites-amd64, where the loader does not look by itself; a run path a contract writes itself stays. Without it, the link names the output’s own folder first, then the way from it to the folder of each shared library it takes outside the system’s library folders, and a shared library its runtime floor’s folder last, so a program starts where it was built and after a copy — requires --link, not for archives, not with --run | |
-st | --static | link the program wholly statically, so the binary carries its own libc and runs on a machine that has none — program outputs only, requires --link; a shared object that a library’s contract names by path is refused by the library’s name, because a wholly static program holds none, and the library’s archive is the way out | |
-sp | --strip | strip the symbol table from the linked program or shared object, the shipping shape; without it a build of any tier keeps every function’s name, so a profiler, a backtrace and a debugger read the program’s own procedures — requires --link, not for archives | |
-sa | --sanitize | address · undefined · thread | link the program under a C sanitizer, so the C beneath it runs checked and the first error ends the program with a report naming the C file and line — program outputs only, requires --link; the sanitized builds below say what it links and what it needs. Combines with --run |
Sanitized builds
--sanitize address links a program under the GNU C compiler’s address
sanitizer, which catches out-of-bounds and freed-memory accesses,
--sanitize undefined under its undefined-behavior sanitizer, which catches
overflows, misaligned and null accesses and invalid shifts, and
--sanitize thread under its thread sanitizer, which catches data races
between the threads a multicore program runs its tasks on. The program’s own
code is built exactly as without the flag. What changes is what it links: the
sanitizer’s runtime, and the Dragon runtime built under the same sanitizer, so
every line of C beneath the program runs checked — the runtime’s own, and any
C library of yours compiled with the matching option, -fsanitize=address,
-fsanitize=undefined or -fsanitize=thread. The first report names the C
file and line and ends the program; a thread report names both accesses of
the race, and the program ends with exit code 66. A program over a Mica shared
library runs on the shared runtime floor built under its sanitizer, so the
runtime beneath the program and every library it loads runs checked; the
library itself is built as always, without the flag. A thread-sanitized
program is multicore, and a shared library built for one carrier joins it,
while the same library’s archive is refused until it is built with
--tasking multicore like the program: build the archive that way when you
switch from the library’s shared object to its archive.
mica --compile --link --sanitize undefined --source Hello.mica --build build
./build/HelloThe runtime built under the sanitizers is an optional package beside the Dragon
runtime, under the same licence. It depends on gcc, whose packages bring the
sanitizer runtimes:
sudo apt install ./mica-dragon-rt-sanitizers_<version>_<arch>.debA program linked under a sanitizer says so in its
manifest: mica --inspect prints
"sanitizer":"address", "sanitizer":"undefined" or "sanitizer":"thread",
and "sanitizer":null for every other program. The address sanitizer serves
the hosted heap, the undefined-behavior sanitizer every memory class and
tasking flavor, and the thread sanitizer the multicore tasking flavor in
either memory class. A checked build of a program with a heapless routine
admits the address and the undefined-behavior sanitizer, and refuses the
thread sanitizer, which takes the C allocator’s entries the heapless watch
reads and shows it only some of its blocks. A sanitized
program finds the sanitizer’s runtime as a shared library when it starts, so it
runs on a machine with the GNU C compiler’s runtime libraries installed: it is
a build for finding errors, not the one you ship.
A sanitized build the compiler cannot link is refused with one line:
| Situation | The line |
|---|---|
beside --static | The address sanitizer's runtime is a shared library the program finds at start, and a wholly static program finds none - drop the '--static' selection or the '--sanitize' selection |
| for a library output | The address sanitizer's runtime joins a program, and a library is linked without it - link the library without '--sanitize', and the program that links it with '--sanitize' |
address beside --memory-class fixed-arena | The address sanitizer watches the blocks the C allocator hands out, and a fixed-arena program takes its cells from its own arena, where the sanitizer never sees them - name the hosted-heap memory class, or the undefined-behavior sanitizer |
thread beside the single-tasking flavor | The thread sanitizer watches the threads a multicore program's carriers run on, and a single-tasking program runs every task on one thread - name the multicore tasking flavor, or the address or undefined-behavior sanitizer |
thread beside a checked program with a heapless routine | The thread sanitizer takes the C allocator's entries for itself, and a checked program with a heapless routine points the same entries at the watchers that keep the routine's promise - drop 'checked' from '--optimize', or name the undefined-behavior sanitizer |
| the sanitized runtime not installed | The undefined-behavior sanitizer needs the runtime floor built under it, which is not installed here: the file 'mica-dragon-rt-sites-ubsan-amd64.a' is missing from '/usr/bin' and '/usr/lib'. Install the 'mica-dragon-rt-sanitizers' package from https://mica-dev.com/ |
| a value other than the three | invalid value for sanitizer 'memory': '--sanitize' takes 'address', 'undefined' or 'thread', one sanitizer per build |
without --link | a sanitizer's runtime joins the program at its link, so the sanitize option requires the link option |
A target whose C compiler installed no runtime for the sanitizer, such as the other architecture before its cross compiler is installed, is refused by the files the link looked for.
Target selection
| Flag | Value | Effect |
|---|---|---|
-pf | --platform | os,arch,encoding | the target platform, e.g. linux,arm64,utf-8 — requires --compile. Combines with --run |
-asm | --assembly | intel · att | the emitted assembly syntax; the default is intel — requires --compile |
The accepted values: operating system linux; architecture amd64 or
arm64; string encoding utf-32 or utf-8. All four Linux combinations are
valid. When no platform is named, the build targets the machine it runs on:
Linux with the host’s own architecture, utf-32 encoded. The string encoding is
fixed per binary — utf-32 is the general-purpose default, utf-8 the
interop-oriented choice; format specifiers follow it (%ls under utf-32,
%s under utf-8), and the compiler checks them at compile time.
Optimization
| Flag | Value | Effect |
|---|---|---|
-o | --optimize | comma-separated set | select the optimization profile and passes — requires --compile; when the flag is omitted entirely, the build is a plain debug build |
The three spellings almost everyone uses:
| Level | Expands to | Meaning |
|---|---|---|
O0 | debug | every variable observable, every line breakable, every GPU kernel finished before the program goes on — the profile a debugger wants |
O1 | release,standard_optimizations | the release profile with the standard pass set |
O2 | release,full_optimizations | the release profile with the full optimizing set |
What each level is for
| Level | Reach for it when |
|---|---|
O0 | you debug. Nothing is optimized, every variable lives in the stack frame where a debugger can read it, and every cell on the heap records the line that made it |
O1 | you study what the compiler does, or want optimized code that still reads like the source. The optimizer’s passes run on the static-single-assignment form, but every routine stays its own and every loop keeps the shape you wrote, so an export’s listings and the editor’s drawings are easy to follow |
O2 | you ship or you measure. It adds what makes the code fastest and moves it furthest from the source |
O1 leaves out exactly three things O2 has: inlining, so a call stays a call
and each routine has a listing of its own; the three loop steps, loop-invariant
code motion, strength reduction and loop rotation, so a while loop keeps its
test where the source has it; and the graph-colouring register allocator, in
whose place the simpler linear scan assigns the registers. Everything else the
optimizer does, it does at both levels, and what each level does
lists it.
O3 is refused by name, with an explanation: the transformations that would
distinguish it from O2 — vectorization, loop unrolling — do not exist yet,
and an alias that silently meant O2 would be a promise the compiler does not
keep.
The set may also name its members directly: the profiles debug and release
(mutually exclusive; naming neither in a non-empty set defaults to release),
checked for the checked runtime diagnostics, a flag beside either profile —
O2,checked ships every guard on the optimizing lowering, debug,checked keeps
every variable observable at the trap, and checked alone means release,checked
as any set naming no profile means release —
profiling for the line table, the subprogram entries and the inlining records at any
tier — O2,profiling is the build a profiler attributes to source lines and a debugger
shows an inlined procedure in as its own frame, with no variable locations and the
instructions of the plain build, beside the storage a debugger’s readings are written
into (what each level does says what else differs) — the
group names standard_optimizations and full_optimizations, and the
individual pass names constant_folding, assembly_peephole,
stub_allocator, graph_allocator, function_inlining,
loop_optimization, fp_contract, heap_contract — plus the two
code-generation modes il_static_single_assignment and il_direct_lowering,
which are mutually exclusive and exist for differential testing of the
middle end. Individually named passes are an instrument for working on the
compiler; programs are shipped with O0, O1, or O2.
What each level does
| Level | Code path | Register allocator | Debug information | Runtime floor |
|---|---|---|---|---|
debug (O0) | direct lowering | none: every value lives on the stack | full | records the allocation site of every cell |
release | static single assignment | linear scan | none | plain |
release,standard_optimizations (O1) | static single assignment, assembly peephole | linear scan | none | plain |
release,full_optimizations (O2) | static single assignment, assembly peephole, inlining, loop optimizations | graph colouring | none | plain |
release alone takes the static-single-assignment road with no pass beside it:
it is the setting that exercises the middle end in isolation, and a program
ships with O1 or O2. A set that names no level is a release build, so
full_optimizations alone is the same build as O2. profiling adds the line
table, the subprogram entries and the inlining records to any release level.
In such a build, a breakpoint on the line of a call the optimizer inlined stops
at the first instruction of the inlined body, before the call has run, in the
inlined routine’s frame with the call’s line beneath it; the line table’s entry
for the call covers no instruction, so a profiler attributes every instruction
to the same line as it would without it.
The standard library is the same prebuilt archive at every level.
profiling changes no instruction the compiler writes: the program’s routines
and the standard library’s hold the same instructions, on the same registers and
in the same order, as in the build without the flag, and so do the runtime’s but
for the few on x86-64 that the second point below names. Beside its
tables, a profiling build reserves the storage the runtime writes a debugger’s
readings into, as a debug build does and a release build without the flag
does not:
- 139,264 bytes of zeroed data and two 8-byte words of read-only data that
state the storage’s capacity. The zeroed bytes are address space the loader
maps, counted in the manifest’s
zeroed_bytesandmapped_bytes, and they hold no memory until a debugger writes into them. - A layout around it. The storage’s addresses take dynamic relocations of their own, so the image places its code and data at other addresses, and an instruction that reaches code or data by its distance encodes another distance. On x86-64 the linker also writes the few instructions of the runtime that find the storage as a zero where the storage is absent and as its address where it is present.
The zeroed storage reads on any program, here the container’s Hello example
built at O2 with and without the flag:
mica --compile --link --optimize O2 --source mica-container/examples/Hello/Hello.mica --build plain
mica --compile --link --optimize O2,profiling --source mica-container/examples/Hello/Hello.mica --build profiling
echo $(( $(mica --inspect profiling/Hello | jq .image.zeroed_bytes) - $(mica --inspect plain/Hello | jq .image.zeroed_bytes) ))139264A debugger stopped in a profiling build can ask the runtime for the task tree,
for the frames of every task (mica-task-backtrace in gdb; mica-task-locals
adds each frame’s variables in a debug build), and for the
program’s memory regions. The readings that walk the heap cell by cell need the
allocation records only a debug build keeps, so a profiling build answers them
with needs-debug, as a release build without the flag answers every reading.
At O1 and O2, the levels that run the assembly peephole, a branch that
only chooses which value a local variable takes is compiled without a jump
where the variable lives in a register: as a conditional move on x86-64 and
a conditional select on AArch64. release alone keeps the branch.
Leaving SSA shows the conversion in a program’s
export.
Every level computes the program’s constant expressions when it compiles: a
debug build holds the value of Limit * 2 as an O2 build does, so a
constant has one value whatever the level, and no flag that changes the run
time’s arithmetic gives it a second one. The pass name constant_folding
names that computation: O1 and O2 list it among their passes, in the
manifest --inspect prints as well, and a set may still name it, which
changes nothing the build makes.
A program that computes on an NVIDIA GPU may add fp_tensor_float32:
O2,fp_tensor_float32 lets every float32 matrix product the program runs, the
reverse products of its tape included, read its inputs in TF32 on the card’s
tensor cores — ten bits of mantissa beside float32’s exponent range, sums kept
in float32 — the setting nanoGPT trains with. An attention keeps float32’s
precision either way, as PyTorch’s float32 attention does under that setting.
A product’s digits then differ from float32’s from about the fourth
significant one on, which is why the flag belongs to no level and is named
only for a program; a library’s build refuses it, because the program that
links the library decides for all its products.
Every release build, O1 and O2 among them, lets the GPU work through its
kernels and products while the program goes on, and a copy back to the
processor waits for their results; O0 waits for each one, so a kernel that
fails is named where it failed.
Deployment classes
| Flag | Values | Effect |
|---|---|---|
-mc | --memory-class | hosted-heap · fixed-arena · fixed-arena=<bytes> | the memory deployment class; selects the matching runtime floor. hosted (default) uses the operating system’s heap; fixed-arena places the whole program heap in one arena of the given size, for deployments that must not allocate after start |
-tk | --tasking | single · multicore · multicore,<carriers> · multicore,<carriers>,fixed | the tasking flavor. multicore runs tasks on a carrier pool and links the multicore runtime floor; the count, from 1 to 1024, is the pool’s size unless the program is started with a carriers runtime flag, and with no count the pool sizes itself at start to the processors the program may use (the least of the processors online, its affinity mask and its cgroup’s CPU quota, see how many carriers a pool starts). ,fixed pins the count: the program refuses the carriers flag |
-rp | --runtime-profile | full · light | the runtime profile: which runtime floor the program stands on. full (default) links the floor that carries the scheduler beneath tasks, generators and streams and the tensor kernels beneath tensor arithmetic, tracked values and on gpu placements; light links the light floor, which carries neither: a construct that needs one is refused where it is declared, and tensor arithmetic at the operation. Combines with --run |
-ps | --processes | a count | how many worker processes run the tasks the program places on processes at once, from 1 to 1024; a task placed beyond the count waits until a worker ends. The program’s processes runtime flag replaces the count at start, and without one the count is the processors the program may use (see how many worker processes run at once). A program’s decision: refused for a library. Combines with --run |
-rf | --runtime-flags | open · sealed · sealed,rtp · none | what the built program accepts in the runtime-flag group at the head of its arguments: open every flag the build did not pin (the debug default), sealed only info, check, gpu=<n>, stdout=line and heap (the release default), sealed,rtp those and the runtime protocol’s rtp= flags, none no group at all |
The light runtime profile
--runtime-profile light links the light floor: the runtime floor without
the scheduler and without the tensor kernels, at about half the full floor’s
archive. Strings, maps, new and dispose, both memory classes, files,
sockets, pipes, callbacks and sleeping work on it, each wait a plain blocking
call on the program’s one thread. A project states the profile as
"runtime-profile": "light", which the flag overrides, and the program’s
manifest records it as
"runtime_profile":"light","floor":{"families":[]}.
The light runtime profile walks a program through it.
Before it compiles, the compiler reads which parts the floor it resolved
carries. A task, a generator, a stream, a tracked value, a tape window, an
on gpu placement and a call only the scheduler answers, such as Yield, are
refused where they are declared, whether or not the program uses them, in the
build and in the editor alike:
analyzer error 5805: 'Talker' is a task, and the runtime floor 'mica-dragon-rt-sites-light-arm64.a' carries no 'tasking' family: build the program on the full runtime profile, whose floor carries it, or write the work as a routineA tensor is judged by its use: holding, copying and reading one build on the light floor, and tensor arithmetic that calls the kernels, a matrix product among them, is refused at the operation as its code is written, by the build alone:
emitter error 22080: this operation needs the runtime floor's tensor kernels, which the floor 'mica-dragon-rt-sites-light-arm64.a' leaves out: its code refers to '__mica_tensor_product_f64' of the 'tensor' family; build the program on the full runtime profile, whose floor carries it, or compute it element by elementA Mica library records the parts of the floor its code reaches, its own and those of the libraries it imports. A program on the light floor imports one that reaches neither, whatever profile it was built for, and refuses one that reaches either at the import:
analyzer error 5806: the library 'Lone', or a library it imports, reaches the runtime floor's 'tasking' family, and the runtime floor 'mica-dragon-rt-sites-light-arm64.a' carries no 'tasking' family: build the program on the full runtime profile, whose floor carries it, or import a build of the library that does not reach itCode the compiler did not write, a C library’s, is the linker’s to judge: where the linker reports an entry of a part the floor leaves out undefined, the compiler names that part and the way out beneath the report.
What the light floor cannot serve is refused with one line before anything compiles, or at the link:
| Situation | The line |
|---|---|
beside --tasking multicore | The light runtime profile's floor carries no 'tasking' family, so it has no carriers to pool - name the single tasking flavor, or build on the full runtime profile |
beside --processes | The light runtime profile's floor carries no 'tasking' family, so it has no worker processes for a count to size - drop the '--processes' selection, or build on the full runtime profile |
beside --sanitize address | No floor of the light runtime profile is built under the address sanitizer - build on the full runtime profile to run the program sanitized, or drop the '--sanitize' selection |
for a shared object, --output-modifier object | A Mica shared object names the shared twin of its runtime floor, and the light runtime profile's floor has none - link the library as an archive, or build it on the full runtime profile |
| the light floor not installed | The light runtime profile needs its runtime floor, which is not installed here: the archive 'mica-dragon-rt-sites-light-arm64.a' is missing from '/usr/bin' and '/usr/lib'. Install the 'mica-dragon-rt' package from https://mica-dev.com/ |
| a Mica shared object on the link line | Failed to link: the library 'Doubling' is linked as a Mica shared object, which names the shared twin of its runtime floor, and the light runtime profile's floor has none: link the library's archive in its place, and rebuild against that archive every library whose contract names the shared object, or build the program on the full runtime profile |
| a value other than the two | invalid value for runtime profile 'tiny'; expected 'full' or 'light' |
A library built on the light profile cannot export a generator template.
Diagnostics and analysis
| Flag | Value | Effect |
|---|---|---|
-ss | --stack-size | bytes | give the program this many bytes of stack: every frame the stack holds compiles quietly and a frame it cannot hold is refused — in both directions, so a small embedded request tightens the limit — while the default stack warns at frames above 1 MiB; a linked program raises its own stack limit before main runs (default: the platform’s 8 MiB). Combines with --run |
-vb | --verbose | report the per-source optimization statistics beside the build: what each pass folded, inlined, forwarded, elided and declined — requires --compile | |
-rm | --remarks | report the compiler’s remarks: hints from its own knowledge about your code — be careful here, or do it another way. A remark never gates a build and is spoken only when asked for; combines with every road, --run included — requires --compile | |
-exp | --export | write every intermediate representation to the build directory — requires --compile; the compiler, exported walks every stage | |
-pr | --profile | print a per-phase and per-pass compile-time table and write profile.json to the build directory — requires --compile | |
-q | --quality | semantic_analysis · intermediate_code · machine_code · no_quality_gates, several joined by commas | extra verification runs inside the compiler, for root-cause analysis of internal compiler errors: semantic_analysis checks the analyzed syntax tree, intermediate_code the intermediate code after its generation and after placement, machine_code the machine code the peephole pass of O1 and O2 leaves — requires --compile |
-cp | --cpu-profile | file | write a CPU profile of the compiler itself to the file |
-mp | --mem-profile | file | write a memory profile of the compiler itself to the file |
The combination rules
The compiler refuses inconsistent combinations rather than guessing:
--link requires --compile; --no-pie, --no-run-path, --static, --strip, --emit-contract,
--emit-header, --output-modifier, --external and --sanitize require --link;
--standard-library-unit requires --output-modifier archive or object; --optimize,
--platform, --assembly, --export, --profile and --quality require
--compile; --purge requires --build. Each refusal names the rule.