Mica — the language

The Mica Compiler Project

One developer. Years in the making. One real compiler.

The Mica Compiler Project began in late 2023 out of a simple frustration: the languages that are easy to read keep you far from the machine, and the languages that give you the machine make you pay for every mistake in memory. Mica was created to refuse that trade-off — to read clearly, to run as fast as C, and to be safe by construction rather than by vigilance.

What emerged is a statically typed, natively compiled systems language with a guarantee the mainstream doesn't offer: memory safety the compiler proves. Leaks, use-after-free, and double-free are caught at build time by flow analysis — no garbage collector, no borrow checker, no lifetime annotations. It targets native Linux x86-64 and ARM64, carries no external dependencies, and links directly against any C library on the system, in both directions. The compiler behind it is more than 100,000 lines of pure Go, built entirely from scratch — without LLVM, without GCC, without shortcuts.

Values, not hidden references. Mica is built on one uniform principle: a variable holds a value, and the only way to share data is an explicit pointer. Assignment produces an independent value. Passing an argument produces an independent value. There is no reference that silently turns one name into two, and no surprise about whether two variables share storage. When you want sharing, you write a pointer, and that intent is visible at the point you declare it. This is what-you-see-is-what-you-get applied to memory: a program means exactly what it says.

This is not an idiosyncratic choice. It is a disciplined position known in the literature as Mutable Value Semantics (MVS) — the discipline formalized by Dave Abrahams, Dimitri Racordon, and John McCall, and realized most fully in the Val/Hylo language. In that model references become second-class citizens: they cannot be stored in variables or fields, so the meaning of a program never depends on invisible aliasing. Mica adopts this discipline and adds a single pragmatic, visible primitive — an explicit pointer, owning or borrowing — for the cases where sharing is genuinely intended. The result places Mica in the company of Swift's value types and the long Pascal and Ada tradition, rather than the reference-everywhere model of C++ or the lifetime calculus of Rust.

The contrast with Go is instructive. Go mixes value types with reference-semantics types, so a plain assignment sometimes copies a value and sometimes silently aliases a shared backing store. That inconsistency is precisely the hidden semantics Mica rejects. In Mica, assignment always yields an independent value, and sharing is always spelled with a pointer. The rule has no exceptions, so a reader never has to know a type's secret aliasing behaviour to understand a line of code.

Value semantics is often assumed to be slow, but in practice its two dominant costs vanish by default. Passing a large value to a procedure that only reads it — or that updates it in place — is zero-copy: the parameter borrows through a pointer, the same way C++ made const& the idiom and Pascal generalised the var parameter. The result of an operation is constructed directly in its destination rather than copied into it, so the natural numerical expression — multiplying two matrices, accumulating a vector — runs without incidental copies, while the language keeps its promise that no two names share storage unless you said so. You reach for a pointer precisely when you mean to, and never by accident.

Safety, finally, is enforced without asking the engineer to internalise a borrow checker or annotate lifetimes. Ownership is tracked statically where the compiler can see it, and the remaining cases are caught by a deterministic runtime floor that traps misuse rather than letting it corrupt memory silently. The principle is "trap, don't corrupt": a checked program that runs clean is correct. Mica trades a measure of compile-time proof for a model a working engineer can hold in their head — values, explicit pointers, and a safety net that fails loudly instead of silently.

This site is organized around learning the language and documenting the compiler.

Release 5.0.0 · in development

The next major release is being built right now and is expected in summer 2026, with native support for both ARM64 and AMD64. 5.0.0 is the big one: a heap whose memory safety the compiler proves and a real optimizing backend. The documentation here already describes its core features — with more still landing, including the broader standard library and dynamic-array and string support.

Chapter 1 — Overview

What Mica is, the headline numbers, why it exists, and what makes this compiler different.

June 14, 2026 · 7 min · Michael Petersen

Chapter 2 — The Language

Mica as a programmer sees it — structured control flow, the ordinal type universe, records and pointers, nil, and linked structures.

June 14, 2026 · 11 min · Michael Petersen

Chapter 3 — Memory & the Heap

The flagship of 5.0.0 — heap memory whose lifetimes are proven safe at compile time by flow analysis, served by compiler-scheduled plug-in allocators.

June 14, 2026 · 10 min · Michael Petersen

Chapter 4 — The Pipeline

The front and middle end — scanner, parser, AST, type system, semantic analysis, and the Spectra intermediate language.

June 14, 2026 · 8 min · Michael Petersen

Chapter 5 — The Backend

The SSA optimizing backend new in 5.0.0 — inlining, CFG, SSA, dataflow/liveness, register placement, the dual x86_64/ARM64 lowering, peephole optimization, and ELF/DWARF v5.

June 14, 2026 · 7 min · Michael Petersen

Chapter 6 — Platform & Interop

Mica's platform bet — JSON library contracts, first-class C interop, the standard library, automatic UTF handling, the compiler driver, and cross-compilation.

June 14, 2026 · 8 min · Michael Petersen

Chapter 7 — Performance

The benchmark story — Mica against gcc -O2 on scalar kernels, the allocation-bound workload where the region allocator wins on instructions, the additive cost of the heap, and compile speed.

June 14, 2026 · 5 min · Michael Petersen

Chapter 8 — Testing & Architecture

The harness-first discipline and the test suite, the shape of the codebase by subsystem, and how the compiler is built.

June 14, 2026 · 5 min · Michael Petersen

Chapter 9 — Roadmap & History

Where 5.0.0 sits, the road toward the 6.0 AI track, Mica as a learning resource, the project's history, and the license.

June 14, 2026 · 6 min · Michael Petersen

The Mica Optimizing Compiler — 5.0.0 Technical Summary

A comprehensive feature summary of the Mica Optimizing Compiler 5.0.0: the language, compile-time memory safety by flow, the heap runtime, the SSA backend, dual-architecture code generation, performance, and how it stands against GCC 15.

June 14, 2026 · 12 min · Michael Petersen