Mica is a statically typed systems language with its own optimizing native backend — no LLVM, no GCC backend, no third-party dependency anywhere in the implementation. It is influenced by Pascal, Ada, and C. Three commitments shape everything on this page: the compiler proves at compile time what most toolchains leave to the debugger; a program’s output is deterministic to the digit — on both architectures, at every optimization tier, and even across serial and parallel execution; and the numeric stack up to a training loop on a GPU is part of the language, not a package ecosystem bolted on.
Everything below can be checked in an afternoon: the compiler is free for any
use including commercial, and docker run -it micalang/mica is a complete
environment — compiler, debugger, examples, benchmarks.
What the compiler proves at compile time
Each row is a hard guarantee with its own documented mechanism, not a lint:
| Guarantee | Mechanism |
|---|---|
| Heap lifetimes | every allocation is an obligation with exactly four discharges — dispose, defer, return, or owner binding; use-after-free and double-free are compile-time reports, with no garbage collector, no borrow checker, and no lifetime annotations |
| Data-race freedom | every touch of shared state must sit under synchronized; a call cannot launder a shared access; proved at compile time, and the compiler’s own test gate runs under a race detector |
| Task lifetimes | the task tree is the scope tree: a concurrent block joins every task it started on every exit path — no detached thread exists in the language |
| Array and tensor bounds | indices are checked against the type’s own bounds at compile time where provable, trapped at a named source line where not; the optimizer removes only the checks it has proven away |
| Tensor shapes | vector[N] and matrix[R, C] carry shape in the type — a product whose dimensions cannot meet is refused before the program exists |
| Format strings | checked against their arguments at compile time, under either string encoding |
| Failure handling | a fails function cannot be called without visibly consuming the failure — the compiler makes every call finish the story |
| Case totality | a case over an ordinal domain answers every value or names its default |
| Byte transport | only plain values — bytes-are-the-value types — may cross a task spawn, a typed file, or the C ABI; a heap descriptor’s bytes are uncompilable as transport |
| Data-race-free by construction on the borrow | a span borrow is formed at a visible Span, lives inside a lifetime the caller can see, and freezes growth of what it borrows |
The rule behind the table is deliberate. Mica proves at compile time what is provable, and for the scenarios today’s analysis cannot prove, a checked build plants a trap: the program stops at a named source line instead of proceeding corrupted. This is the language’s chosen middle way — no ownership model, no borrow checker, no lifetime annotations — because readability and low complexity for the developer are a top priority of the design, not an afterthought. Where a guarantee is usually bought with annotation machinery, Mica researches the pragmatic road to the same result: prove what the compiler can see, trap loudly on what it cannot yet, and move scenarios from the second list to the first with each release. The same discipline governs efficiency and footprint — small binaries, small images, and no runtime cost for features a program does not use.
What stays exact at run time
Determinism in Mica is a language property, not a library option:
- The same digits on every machine. The whole test corpus is gated on both architectures per release; the teaching examples print byte-identical output on x86-64 and AArch64 at every optimization tier.
- Parallel equals serial. Reductions (
Sum,Mean, the extremes) run on one documented pairwise tree — the same tree serially and in parallel, so a float reduction gives bit-identical answers at every carrier count. A multicore run of the SIMD benchmarks is bit-identical to the serial run. - Checked arithmetic. At the checked tier, integer overflow traps at a named source line — scalar and tensor alike — instead of wrapping silently.
- Reproducible randomness. The
randomunit is seeded and bit-stable on every machine; a shuffled benchmark shuffles identically everywhere.
The practical consequence: a training run — including the GPU-resident one — prints the same loss column on every machine, every time. That claim is on the AI course, where every chapter keeps it.
Machine learning inside the language
Not a framework: language surface, with the compiler’s checks applied to it.
- Autograd is a language feature.
trackedvalues record onto a tape inside atape … endwindow; oneBackwardwalk answers every gradient throughGradient. The recorded vocabulary — the tensor operators plusSum,Tanh,Softmax,LayerNorm,CrossEntropyand their family — keeps each verb’s plain signature and shape rules. - The GPU is a residency, not a dialect. A tensor declared
on gpukeeps its type and moves its storage; values cross only at visibleToDevice/ToHost. The tensor verbs dispatch to the device by residency, through PTX the compiler ships itself — an NVIDIA card of compute capability 7.0 or newer and a resident driver are the whole requirement; no CUDA toolkit is installed. Host and device training produce digit-identical loss columns. - A GPT is the worked example. The repository’s
samples/gpttrains a 786944-parameter transformer with every mechanism above — walked chapter by chapter in the twelve-part AI course, from the first nudge loop to text in your corpus’s style, reproducible to the digit.
The language, briefly
- Values are values. Assignment and argument passing copy, all the way
down; sharing is a visible
pointer, anaddresswritten at the call, avalueat every touch — never a hidden reference. - Errors are a channel, not a convention.
failsin the signature,failto raise, four visible consumption forms at the call — no error codes, no exceptions, no sum types; C’s errno is lifted into typed codes at the boundary by contract. - Concurrency is structured. Tasks, generators, streams over bounded
rings,
selectwith timeout — with the join guaranteed by scope and the capture discipline checked at compile time. - Generics with capability constraints. One algorithm over many types,
monomorphized; constraints (
numeric,ordinal,plain, …) are checked against the body and every call. - Memory is a deployment class. The same source links against the
hosted heap or a fixed arena —
--memory-class fixed-arena=<bytes>, no code change. A program can run with no heap at all, and indefinitely: drained regions return their blocks for reuse, so a long-running loop’s live set stays bounded inside the fixed budget. Both classes compose with single and multicore tasking, and the test corpus runs under both. The memory-classes tutorial walks it end to end. - Two build-time string encodings. UTF-32 as the general default, UTF-8 for the boundary — one letter of difference in format specifiers, checked at compile time.
What ships in the language
The standard library is written in Mica — twelve units, resolved by plain
imp, no package manager required:
| Unit | What it carries |
|---|---|
std | the core verbs: text output, Dot, Transpose, Backward, Gradient, Length, the everyday surface |
math | generic scalar verbs at full type fidelity, the tensor verb vocabulary (Sum, Softmax, LayerNorm, CrossEntropy, …), slicing (Row, Column, SubMatrix, Window), constants, IEEE classification |
arrays | Sort (native generic heapsort), Insert, Remove, SubArray, List, the dynamic-array verbs |
strings | the string verbs over the two-field immutable value, the stringbuffer builder, the stringpart window |
maps | the typed associative container under the value rule |
integers | the wide family’s int128…uint256 names and the unbounded bigint with verb arithmetic |
files | the typed file over the failure channel |
paths | pure, total path algebra beside the directory walk |
net | connections as values: servers, clients, framed typed transfers, deadlines |
streams | stream adapters over the pull-and-push machinery |
random | seeded, bit-stable generation and shuffling |
regex | patterns compiled to a linear-time engine no input can make pathological |
Beneath them, the C standard library, POSIX, and Linux surfaces ship as
25 curated contracts embedded in the compiler binary — imp Open : posix; works on a fresh install with nothing else on disk, every call
type-checked, every errno lifted into the failure channel. The Dragon SDK’s
own surface is the 26th, for programs that drive the backend.
The toolchain
| Current version | 7.2.0 |
| Targets | Linux x86-64 (x86-64-v3) · Linux AArch64 (ARMv8.0-A) |
| Code generation | own backend, source to ELF — the only external tools invoked are as and ld |
| Cross-building | either architecture from either host, same flags |
| Debug information | DWARF v5 — gdb works on Mica binaries out of the box, across the C boundary and into generic instantiations |
| Editor support | a language server inside the compiler (mica --language-server); VS Code extension as the packaged client |
| Scripting | mica tool.mica compiles and runs like a script; #!/usr/bin/env mica works |
| The C ABI | both directions by declared contract: Mica calls C libraries type-checked, and a Mica archive links into a C program with no runtime to initialize |
| Install | Debian package for both architectures · Docker image micalang/mica |
| Licence | MCL-1.0 — free for any use, including commercial; not open source |
| Dragon SDK | the backend as a C API for building your own language — a separate package, free for noncommercial use |
Where performance stands
Stated the way we measure it, so you can re-measure it:
- The backend is our own, and its optimizer earns its keep: the benchmark corpus retires 46.9% fewer instructions than unoptimized code, with bounds checks proven away rather than merely hoisted.
- Lane-level SIMD reaches 2.33x over scalar on f64 and 4.03x on f32; data-parallel execution on 8 cores reaches up to 4.0x — bit-identical to the serial result at every carrier count.
- On general-purpose code,
gcc -O2still leads; specific numeric loops reach or pass parity. We publish the gap and work on it each release — performance and method carries the numbers and the measurement discipline. - The benchmarks live in the container you can pull:
benchmarks/besideexamples/, each amakeaway, oracle-checked so a wrong answer fails loudly before a fast one impresses anyone.
The numbers
| Implementation | 201,087 lines of Go in 746 files — zero third-party dependencies |
| Standard library | 27,534 lines of Mica |
| Test corpus | 1,837 test programs · 11,611 declared test runs |
| Cross-architecture | 1,796 programs run on both architectures |
| Verification | every release passes the full corpus through the compiler, through a legacy differential oracle, and under Go’s race detector — see how it is tested |
Figures generated from the repository at 2026-08-23 — no number on this page is typed by hand.
The five goals ahead
The one forward-looking section on this site. In order:
- A native N-dimensional numeric library — dynamic shapes, explicit
broadcasting, dtypes, decompositions born
fails— on the tensor foundation, keeping the bit-exact reduction guarantee. - A neural-network training library on the language’s own autograd, completing the story the GPT sample begins.
- User-defined GPU kernels as first-class language citizens, extending the shipped PTX road beyond the curated verb vocabulary.
- macOS as a full host — today Darwin/ARM64 compiles both Linux targets but cannot link; native linking brings the whole developer story.
- The comprehensive language reference with a published grammar — every rule normatively stated, the EBNF verified against the parser so it cannot drift.
Beside the five, footprint is a working lane rather than a goal that waits:
the next concrete step is a smaller micalang/mica container image,
measured and published like every other number on this page.
Where to go next
Install it · the comparison · what the compiler guarantees · the reference · performance and method