Skip to content
Eira edited this page Oct 31, 2026 · 8 revisions

Lamina

Lamina is a compiler backend for a compact, statically typed IR. It lowers that IR to a machine-level IR, optimizes it, and writes native assembly directly. No LLVM, no Cranelift.

The language and the CLI can still change before 1.0. Not every target is usable. Roadmap lists what works and what does not, and Releases says what the version numbers mean.

fn @main() -> i64 {
  entry:
    %a = add.i8 10, 20
    %result = extend.i8.i64 %a
    %tens = div.i64 %result, 10
    %ones = rem.i64 %result, 10
    %t = add.i64 %tens, 48
    %o = add.i64 %ones, 48
    %w1 = writebyte %t
    %w2 = writebyte %o
    %nl = writebyte 10
    ret.i64 0
}
lamina test_minimal.lamina -o test_minimal
./test_minimal

Output:

30

writebyte writes one byte to standard output. The program splits 30 into two ASCII digits by hand, because there is no print instruction. extend replaces the old zext and sext. Its source type decides the extension: a signed source sign-extends, an unsigned or bool source zero-extends.

The toolchain is four repositories:

Repository Crate Role
lamina lamina IR, MIR, optimizer, code generation, compiler driver, C bindings
ras lamina-ras Assembler. Turns .s into a relocatable object
weld lamina-weld Linker. ELF, Mach-O, PE
lamina-web lamina-web Website and documentation

Start here

Page What it covers
Roadmap Which targets work, what each milestone has to prove, and what is still open
Architecture How a program travels from IR text to an executable, which crate owns each step, and a glossary
IR semantics What the IR means, as numbered clauses: what each operation computes, what traps, and which targets refuse it
Releases Versioning, the two release channels, and what the nightly feature actually gates
Ecosystem Projects built on Lamina, and what writing a frontend involves
Artery target Supporting the Artery kernel: what a freestanding target demands, and the work to get there

For using it:

Embedding Lamina

Contributing

Issues are tracked on SkuldNorniern/lamina. ras, weld, and lamina-web carry their own issues for component-specific work.

Read the Roadmap first. It says which milestone a piece of work belongs to and what still blocks it.

Clone this wiki locally