Low

Compiler

The compiler is written in Go. Pipeline:

StagePackageOutput
Lexinternal/lexertokens
Parseinternal/parserinternal/ast tree
Checkinternal/checktypes attached to the tree
Build IRinternal/irSSA form, one value per machine word
Codegeninternal/amd64x86-64 GNU assembly
Assemble and linkas, ldstatic or dynamic ELF binary

Modules:

The runtime, internal/amd64/sched.asm and internal/amd64/runtime.asm, is emitted with every program and talks to the kernel through raw syscalls. It ends the process with exit_group, so every thread stops.

Scheduler

Linking

Prelude:

Standard library:

Standard library intrinsics:

The garbage collector is a non-moving mark-sweep collector in the runtime:

The derivations are generated as source:

IR

Frame-slot promotion:

Optimiser:

Code generation

Calling convention:

Vectors