Repository navigation
Home
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_minimalOutput:
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 |
| 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:
- Getting started: install, then compile a first module
- IR language reference: syntax, types, instructions, memory model. IR semantics says what that syntax denotes
- Compiler driver: output modes, targets, toolchain selection, register allocators
- Targets and backends: what is tested, what is experimental
- Rust API guide and docs.rs
- IRBuilder reference, for building modules programmatically instead of emitting IR text
- C bindings: opaque handles, explicit ownership, AOT output, and a nightly JIT extension
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.
lamina · ras · weld · lamina-web