Mica 5.0.0 Technical Portrait · Chapter 9 of 9 · reading guide
You’ve reached the end of the tour. This chapter is about direction — where 5.0.0 lands, where the project is going, and why a single-developer compiler is worth a student’s or professor’s attention.
◈ What 5.0.0 delivers
5.0.0 is the largest release in the project’s history and the first intended for the public. Where 4.5 finished a clean structured core, 5.0.0 turned Mica into a language that can manage memory and produce fast code on two architectures.
| Theme | What landed |
|---|---|
| Heap memory | new / dispose / defer / until F / until program; first-class nil; self-referential record types (linked lists, trees) |
| Memory safety by flow | Compile-time obligation analysis; leaks of fully-tracked allocations are inexpressible; four named lifetime classes; an exported memory narration |
| Allocator seam | Hosted (calloc/free), compiler-scheduled per-owner regions, and a freestanding fixed-arena class — selected by proof, swappable at link time |
| Optimizing backend | IL inlining, control-flow graph, SSA construction and passes, dataflow/liveness, graph-colouring register allocation, per-arch peephole optimizer |
| Second architecture | A full ARM64 (AAPCS64) backend mirroring the x86-64 (System V) one, shape-for-shape |
| Performance | Scalar kernels within a small factor of gcc -O2; the region allocator ahead of gcc -O2 on instruction count for an allocation-bound workload |
| Always-on safety | Nil-dereference guard active in every build, classed as memory safety rather than an opt-in check |
What 5.0.0 honestly defers (and the text says so where each appears): the
runtime half of the container rule (owner-bound containers releasing their
elements in one typed drain), compiler-inserted dispose at post-dominating
points, the inbound half of return-transfer obligation tracking, owned dynamic
arrays, broader standard-library coverage, and a fully supported language server.
Further out and research-grade — deliberately not claimed as imminent — sit a
mechanized soundness proof of the tracked core and alias-aware reasoning about a
disposed value reached through a copy. Honesty about what is proven, implemented,
and planned is part of the design — see
Chapter 3.
◈ The road ahead
Through 2026 — consolidation (the 5.x line). A modern, Mica-native text and
string runtime (borrowed text ranges, growable buffers, an explicit narrow-UTF-8
boundary for C APIs); standard-library modernization with compiler-emitted JSON
contracts so published and imported surfaces use one artifact; curated external
contract packs for well-known C libraries and first POSIX / Linux API access;
language ergonomics (variable initializers, assert/panic, bounds-checked
subranges); a supported editor experience built on a language server; and the
owned-data-structures work that completes the container story.
The 6.0 AI & numeric track (targeted ~Q4 2026) — stated direction, not present. This is the strategic direction that keeps Mica distinctive. None of it ships in 5.0.0; it is described here as a plan with a date, not a current feature, and the honest reason it is credible is that each piece grows out of foundations already in the compiler rather than being retrofitted:
- Mathematical types — fixed-shape vector and matrix types as built-in primitives, with compile-time shape and dimension checking grown directly out of the ordinal type system (Chapter 2) — the same machinery that bounds an array index will bound a tensor dimension. Mixed-precision numerics and compiler-native automatic differentiation round it out.
- Hardware — SIMD/AVX lowering for vector and matrix operations, then GPU and accelerator offload once CPU vector semantics are solid.
- Concurrency — structured lexical workers built on nested procedures; coroutines and generators; a documented memory model and atomics. (The memory analysis already detects the escape and cross-scope-sharing cases concurrency will need; enforcement arrives with the concurrency surface.)
- Ecosystem — AI library contracts (BLAS, cuBLAS, oneDNN) reached through the
same contract system that already reaches
libm, and an interactive workflow for numerical work.
Mica source files are UTF-8, which leaves the door open to genuine mathematical notation in the numeric surface — a natural fit for the AI track, and another case of capability following from a foundation already in place rather than a bolt-on.
The through-line is consistent: Mica grows new capability out of the foundation
it already has, rather than retrofitting it. Ordinal types become tensor shapes;
the region machinery that proves heap lifetimes becomes the machinery that
schedules allocators; the contract system that reaches libm reaches cuBLAS the
same way.
◈ For students, professors, and enthusiasts
If you are interested in compiler construction, Mica is an unusually clear learning resource — and this portrait was written with you in mind.
- A complete pipeline in one repository, one implementation language, zero external dependencies — scanner through ELF binary, now including a real SSA backend.
- A real target: actual x86-64 and ARM64 ELF binaries, not bytecode for a VM.
- Real debug information: DWARF v5, usable in GDB right now, on both architectures.
- Inspectable IR at every stage — and a compiler that will narrate its memory decisions on request.
- A test suite that is the specification, not an afterthought.
The architecture maps cleanly onto a modern compiler course:
| Topic | Where it lives in Mica |
|---|---|
| Lexical analysis | the scanner and token model |
| Syntax analysis | the recursive-descent parser |
| Intermediate representations | the AST and the Spectra IL |
| Type systems | the type system |
| Semantic analysis | the analyzer and the constant evaluator |
| Dataflow analysis | the dataflow and obligation analyses |
| Code generation | the IL generator |
| SSA & optimization | SSA construction and its passes, the inliner, the CFG |
| Register allocation | the placement layer |
| Target code generation | the dual lowering backend |
| Object file formats & debug info | the ELF encoder and the DWARF generator |
The difference between Mica and a textbook toy is that the problems textbooks wave away are all solved and all tested here: nested-function activation records, aggregate passing by value across the ABI, packed type semantics, two real architectures — and now compile-time heap-lifetime proof and an SSA backend.
◈ Project history
| Period | Milestone |
|---|---|
| 2023 | First commit — the journey begins; scanner, parser, AST, and type system take shape |
| The middle years | Semantic-analysis hardening; full aggregate types (packed records/arrays, sets, enums, subranges); interop contracts; native code generation; DWARF v5 |
| 2026 | Versions 4.0 → 4.5 → 5.0.0: control flow, the heap, memory safety by flow, the SSA optimizing backend, the ARM64 target, the allocator seam |
Over 2,799 commits since that first commit in 2023, and over 4,500 test cases holding the line. One language, one compiler, one goal: a clean, teachable, systems-capable compiler that tells the truth — about the machine, about the ABI, and about its own limitations.
◈ 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 license agreement.
- Contact: info@mica-dev.com
Mica is being built in the open because compilers deserve to be understood — not just used. If you have read this far, you are exactly the kind of person this project was built for.
← back to the reading guide · or read the one-page summary