Getting started

A 10-minute tour through Niell β€” install, first program, second program, next steps. Assumes Linux x86_64 with clang installed; for other platforms see Install.

Quick install

sudo apt install -y clang xz-utils
curl -L https://niell.dev/dl/niell-linux-x86_64.xz | xz -d > niell
chmod +x niell
sudo mv niell /usr/local/bin/
niell --help

The binary is self-contained with respect to LLVM 18 β€” you don't need to install the Rust toolchain. You do need clang because Niell invokes it to link the C runtime with the emitted IR.

Your first program

Create hello.niell:

action main
  show with "hello, niell"
end

Compile and run:

niell hello.niell -o hello
./hello
# β†’ hello, niell

niell produces three files alongside the source:

A program with types and actions

Niell lets you declare compound types and actions that operate on them. Create geometry.niell:

type Point has
  x: number
  y: number
end

action distance with a: Point, b: Point -> number
  dx: number = b.x - a.x
  dy: number = b.y - a.y
  return sqrt of (dx * dx + dy * dy)
end

action main
  origin: Point
    x = 0
    y = 0
  end
  target: Point
    x = 3
    y = 4
  end
  show with "distance: {distance with origin, target}"
end

Compile and run:

niell geometry.niell -o geometry
./geometry
# β†’ distance: 5

Notice how:

Compiler introspection

Niell exposes its own description so humans and tools can know what the compiler understands:

niell describe --json | head -20

It returns a versioned schema with keywords, primitive types, built-in modules, prelude, and error code catalog. Useful for writing an agent that writes Niell, or for checking which features are available without parsing the spec.

To inspect a specific error code:

niell explain NIELL-PARSE-001

Next steps

If you get stuck, niell's error codes carry a reference to the spec section where the rule is documented β€” use niell explain <CODE> to navigate it.