Version 5.0.0 · in development · the upcoming first public release

C speed. Compiler-proven memory safety. No GC, no borrow checker, no lifetimes.


A note on accuracy

Mica is developed by a single engineer working with AI assistance. This portrait is the best current description of the language and compiler — but it is a living document. Specific names, API spellings, library namespaces, and feature boundaries change as implementation reveals what actually works. Inaccuracies and inconsistencies can and do occur.

What does not change is the direction and the vision: the platform philosophy, the commitment to explicit semantics, the structured-language foundation, and the AI trajectory are stable.

5.0.0 is a massive release and the first intended for the public. It is large enough that this portrait is split into nine chapters rather than one long page. Where a feature is designed but not yet fully wired, the text says so plainly — honesty about what is proven, what is implemented, and what is planned is part of the design.


What this is

This is a guided portrait of a real compiler. Mica is a systems programming language with clean, structured syntax and explicit low-level control, compiled — from scratch, in pure Go, with zero external dependencies — all the way down to native Linux x86_64 and ARM64 ELF binaries with DWARF v5 debug information, using only the GNU assembler and linker as final tools. No LLVM. No GCC backend. Every phase, from lexical analysis through SSA optimization and register allocation, lives in this one repository.

The nine chapters take you from the language a programmer writes, through the memory model and the optimizing backend, down to the ELF binary and the debugger — each at reading pace, each building on the last. You are never stuck, and you are never bored.


How to read this

Read the nine chapters in order for the full tour — the path for someone meeting Mica for the first time, or for a student who wants to watch a complete compiler unfold from source text to machine code. Each chapter ends with a Where to next signpost, so the thread never drops; or jump straight to the chapter whose subject you came for.

If you have five minutes, read the one-page technical summary: every major feature, and how each one stands against GCC 15.


The nine chapters

#ChapterWhat you’ll learn
1OverviewWhat Mica is, the headline numbers, why it exists, and what makes this compiler different
2The LanguageThe language as a programmer sees it — control flow, the ordinal universe, generics, records and pointers, nil, linked structures
3Memory & the HeapThe flagship 5.0.0 work: heap safety proven by flow at compile time, owners, lifetime classes, and the plug-in allocator seam
4The PipelineFront and middle end — scanner → parser → AST → type system → semantic analysis → Spectra IL
5The BackendThe new SSA middle/back end — CFG, SSA, liveness, inlining, graph-colouring register allocation, the dual x86_64/ARM64 backend, ELF & DWARF
6Platform & InteropThe platform bet — the bidirectional C ABI (link, no wrapper), JSON contracts, the standard library, UTF handling, cross-compilation
7PerformanceThe benchmark story — Mica against gcc -O2, the one workload where the region allocator wins, compile speed
8Testing & ArchitectureThe harness-first discipline, the test suite, the architecture, and how it’s built
9Roadmap & HistoryWhere 5.0.0 sits, the road to the 6.0 AI track, the project’s history, and the license

◈ See inside the compiler

Every stage is dumpable. Most compilers are black boxes: source goes in, a binary comes out, and the transformations in between are invisible. Mica is built to be read. A single driver flag — --export (-exp) — makes the compiler emit a human-readable form of each intermediate representation as it is produced:

  • the token stream from the scanner,
  • the abstract syntax tree from the parser,
  • human-readable Spectra IL (typed three-address code),
  • the control-flow graph — basic blocks and the edges between them,
  • SSA form — the same IL after φ-placement and dominance,
  • the generated assembly (x86_64 in Intel or AT&T syntax, or ARM64),
  • and the final ELF binary with DWARF v5 debug information.

Each representation can be inspected and reasoned about on its own, so you can watch a single line of source descend through the whole machine, stage by stage. Paired with the compiler’s memory narration — one line per allocation site, naming the owner, the proven lifetime class, and the allocator it scheduled — this is what makes Mica a teaching instrument as much as a tool. The portrait shows these dumps throughout: Chapter 4 walks the front-end IRs, and Chapter 5 the CFG, SSA, and lowered code.


Headline numbers

A taste of what Chapter 1 lays out in full:

ImplementationPure Go, zero external dependencies
Compiler source (Go)107,642 gross lines across 594 files
Whole project (Go + Mica + C + contracts)≈ 268,000 gross lines
Commits since 20232,799
Test casesover 4,500 (across ~650 programs)
Target architecturesLinux x86_64 (System V AMD64) + ARM64 (AAPCS64)
Debug formatDWARF v5
Heap safetyproven at compile time by flow analysis — no GC, no borrow checker, no annotations
Against gcc -O2scalar kernels within 0.94–1.42×; region allocator reaches 0.80× on one allocation-bound workload (retired instructions)

License

The Mica compiler source is available under the MCL-1.0 (Mica Compiler Non-Commercial License): free for personal learning, private projects, academic research, and teaching; commercial use requires a separate written agreement. Contact: info@mica-dev.com. Full terms in Chapter 9.


Mica is being built in the open because compilers deserve to be understood — not just used. If that is the kind of thing you read documentation for, start with Chapter 1.