Skip to content

Install

Requirements

  • macOS on Apple Silicon (AArch64)
  • Python 3.13+
  • uv (recommended)
  • Xcode Command Line Tools (xcode-select --install) — provides as, ld, and clang

From source

git clone https://codeberg.org/filipsalo/kod
cd kod
uv sync

Building the self-hosted compiler

The Makefile bootstraps everything from scratch:

make bootstrap   # clean rebuild of stage0 + stage1 (sh_kodc)
make stage1      # incremental rebuild
make test        # run pytest

Running

kod is installed as a uv run script:

uv run kod build hello.kod   # compile to a native binary
uv run kod run hello.kod     # build + execute
uv run kod test hello.kod    # run any `test "..." {}` blocks
uv run kod check hello.kod   # parse + codegen; report errors but emit nothing

For a global install:

uv tool install .   # puts `kod` on your PATH

See CLI reference for the full command surface.