The Mica compiler is a single statically linked executable plus its standard library. It has no runtime of its own to install and no daemon to run.
What you need
Two system packages, and nothing else:
| Package | Why |
|---|---|
binutils | Mica emits assembly and hands it to as and ld. It has no built-in assembler or linker. |
libc6-dev | Compiled programs link against the C library and its startup objects. |
On Debian or Ubuntu the package pulls both in automatically:
sudo apt install ./mica_<version>_<arch>.debThe compiler binary itself is statically linked, so it has no library dependencies of its own — the two packages above are for the programs it produces, not for running the compiler.
Supported systems. 64-bit Linux with glibc, on x86_64 (x86-64-v3 or later — Intel Haswell, AMD Zen) or AArch64 (ARMv8.0-A). There is no Windows or macOS build; see platform and toolchain.
Download
Version 6.7.0, built from commit de623e10.
Verify a download with sha256sum against the hash above.
Install
# from the directory holding the .deb
sudo apt install ./mica_<version>_<arch>.debapt resolves binutils and libc6-dev for you. If you use dpkg directly,
install the dependencies afterwards:
sudo dpkg -i mica_<version>_<arch>.deb
sudo apt-get install -fCheck it worked
mica --versionThen compile something. Save this as Hello.mica:
program Hello;
imp
WriteLn : std;
begin
WriteLn("hello from mica");
end.and build it:
mica --compile --link --optimize release \
--platform linux,amd64,utf-8 \
--source Hello.mica --build build
./build/HelloYou should see hello from mica. Substitute arm64 for amd64 on an AArch64
machine.
What gets installed
| Path | |
|---|---|
/usr/bin/mica | the compiler driver |
/usr/lib/mica-stdlib-<arch>.a | the standard library |
/usr/lib/mica-stdlib-fixedarena-<arch>.a | freestanding deployment class |
/usr/lib/mica-stdlib-mc-<arch>.a | multicore tasking |
/usr/lib/mica-stdlib-fixedarena-mc-<arch>.a | both |
/usr/lib/mica-stdlib-utf-8.external, …-utf-32.external | published import surfaces |
/usr/lib/contracts/ | curated C, POSIX and Linux interop contracts |
You do not normally name any of these. The compiler resolves the right archive
from the --platform, --memory-class and --tasking you ask for, and reads
the contracts when a program imports a system function.
One thing that catches people out
The string encoding is fixed per binary, and the format specifier follows it.
Under utf-8 a string is %s; under utf-32 it is %ls. Get it wrong and the
compiler tells you exactly which specifier it expected — it checks format
strings at compile time rather than letting a mismatch reach the output.
Building for the other architecture
Cross-compiling — producing an AArch64 binary on an x86_64 machine, or the reverse — needs the cross binutils, plus a user-mode emulator if you want to run the result:
sudo apt install binutils-aarch64-linux-gnu qemu-user-binfmt
export QEMU_LD_PREFIX=/usr/aarch64-linux-gnuThen name the target architecture in --platform:
mica --compile --link --optimize release \
--platform linux,arm64,utf-8 \
--source Hello.mica --build buildYou also need the standard library for that architecture, which means installing the package built for it.
See also
- Platform and toolchain — targets, ABIs, build axes
- The capability catalog — what the compiler guarantees
- Licensing — free for any use, including commercial