HUB
Sign inSign up
mica logo

micalang/mica

By micalang

•Updated 6 days ago

Statically typed systems language with optimizing native backend, compiled to Linux x86_64/AArch64.

Image
Languages & frameworks
Machine learning & AI
Developer tools
0

6.5K

micalang/mica repository overview

⁠Mica

The official image of Mica⁠, compute you can see through: a statically typed systems language with its own optimizing native backend and a built-in numeric and machine-learning surface, from tensors with compile-time shapes to an autograd tape and GPU-resident training. From formula to GPU in one language.

One pull is a complete working environment: the compiler, the GNU assembler and linker it drives, gdb ready for the DWARF debug information Mica emits, and git for your own work. Nothing else to install.

docker run -it micalang/mica

The container opens a shell, and the compiler answers:

mica --version

⁠Try it in one minute

Inside the container, open a new file in the editor:

nano Hello.mica

Type or paste this program:

program Hello;

imp
    WriteLn : std;

begin
    WriteLn("hello from mica");
end.

Save it with Ctrl+O and Enter, and leave the editor with Ctrl+X. Then build and run it:

mica --compile --link --optimize release,full_optimizations --source Hello.mica --build build
./build/Hello
hello from mica

The compiler builds for the machine it runs on, x86-64 or ARM64, whichever Docker gave you. The result is one native binary: no runtime to install, no interpreter, nothing but the C library every Linux system has. Naming the other architecture, as in --platform linux,arm64,utf-8, builds for that one.

⁠The full development setup

The image is also a ready-made VS Code dev container. Clone the starter repository and reopen it in the container:

mkdir -p ~/source/repos
cd ~/source/repos
git clone https://gitlab.com/mica-dev/mica-container.git
code mica-container      # then: Reopen in Container, and choose Mica Developer

The container opens the starter, and its terminal starts in the folder that holds it, ~/source/repos here, where make -C mica-container/examples/Hello run builds and runs the first example.

With the Mica extension⁠ you get diagnostics, navigation, hovers, and notebooks, and F5 compiles and debugs the file you have open under gdb. The repository carries the whole example suite — from first programs to a GPT trained in pure Mica — plus the benchmarks and the verified notebooks, all working out of the box.

⁠What is in the image

PieceDetail
micathe compiler driver — one statically linked executable
standard library and runtimefor both architectures, resolved automatically
binutils, libc6-devthe assembler and linker Mica drives, and what compiled programs link, for this architecture and the other one
gdbsource-level debugging works immediately on Mica binaries
make, cmakethe examples, benchmarks and libraries of the starter repository each build through a Makefile, and a C library a program imports may build with either
libsqlite3-dev, pkg-configthe system's sqlite, which the starter's Mica library for sqlite links, and the tool the compiler asks for a C library's version
jqreads the one line of JSON mica --inspect PROGRAM prints about a binary
nanoan editor for the first program, inside the container
gitclone a project and commit your work; mica-provision git --git-name "Your Name" --git-email [email protected] gives it the name and e-mail address your commits record
valgrind, hyperfinecallgrind's attribution of instructions to procedures and lines, and the wall clock — the profiling tutorial's tools, beside gdb's inlined frames
mica-provisionthe devkit's installer: mica-provision gcc or llvm adds a C toolchain for work at the C boundary, qemu runs programs built for the other architecture, bench the measurement tools, and sdk fetches the Dragon SDK — the compiler's backend as a C API — on request

The image is deliberately lean: the C toolchains and the SDK install in seconds when asked for, so the pull stays small. It also carries none of apt's package lists, and apt reports a package it has no list for as one that does not exist, so an apt install typed by hand answers Unable to locate package until sudo apt-get update has run once in the container; mica-provision refreshes the lists itself.

⁠Tags and platforms

Every image is published under four tags at once, and they differ in what a reader may rely on. For the current release:

TagWhat it namesMoves
7.8.0-1this exact image, forever: compiler 7.8.0, image revision 1 — what a pipeline pins and a bug report namesnever
7.8.0the newest image carrying compiler 7.8.0when an image fix of that compiler is published
7.8the newest image of the 7.8 linewith every image of the line
latestthe newest image publishedwith every image

The number after the dash is the image's own revision: it counts the images of one compiler version from 1, and rises when the image changes without a new compiler. A revision tag is never published twice, so it can never become a different image.

An image fix is published as the next revision: 7.8.0-2 would be the same compiler 7.8.0 with a fix to the image around it, and it moves 7.8.0, 7.8 and latest to itself. Such a fix is built from the starter repository⁠'s tag of its own name, v7.8.0-2, as the first image of a compiler is built from the tag of its release, v7.8.0.

Every tag is a multi-platform image for linux/amd64 and linux/arm64; docker pull selects your architecture automatically. During the build, each platform installs the released package and runs the compiler before its layer is kept.

⁠Learn more

  • mica-dev.com⁠ — the language in one page, the facts, and the reference
  • Start⁠ — the four roads to a running Mica: the dev container, this image, the packages, a machine in the cloud
  • Learn AI with Mica⁠ — twelve chapters from what learning is, before any mathematics, to a GPT you train yourself
  • Dragon⁠ — the compiler's backend as an SDK, and the course that builds a compiler on it
  • The learn area⁠ — from an empty folder to your first debugged program in fifteen minutes, and onward to the twelve-chapter AI course
  • Installing Mica natively⁠ — the .deb packages, if you would rather not use Docker
  • The starter repository⁠ — this image's Dockerfile, the examples, benchmarks, and notebooks

⁠License

The Mica compiler is free for any use, including commercial work, under the Mica Compiler License 1.0. The Dragon SDK installed by mica-provision sdk is a separate package under its own license. Details: mica-dev.com/company/licensing⁠.

Tag summary
Recent tags
Content type
Image
Digest
sha256:cac0a997a…
Size
209.4 MB
Last updated
6 days ago
docker pull micalang/mica:latest