Skip to content

Start here

Install atoll, make a project, run it and test it — then where to read next.

This page takes you from nothing to a running Atoll program in a few minutes. Every command and every output on it is run by the compiler’s own tests, so what you see here is what you will get.

Install

atoll is one binary: the compiler, the runtime, the formatter, the test runner and the package tools. It is built from source with Rust’s cargo, so you need Rust and git:

git clone https://github.com/workreef/atoll
cargo install --path atoll/code/compiler/rust/crates/atoll-cli

The build takes a few minutes the first time, and puts atoll in ~/.cargo/bin, which rustup put on your PATH. Check it:

atoll --version

It prints the version, the commit it was built from, and the identity of its source — atoll 0.1.0 (f9cd7aadc2d6, source 85424a601bd11e3f).

Your first program

atoll new makes a project: an atoll.toml naming it, and its source in src/. (Already in the directory you want? atoll init makes it a project.)

atoll new hello
Created binary project `hello` at hello

src/main.at is the program:

fn main() void {
    println(greeting())
}

fn greeting() string {
    return "hello from hello"
}

Run it from the project’s directory — atoll run checks it, compiles it and runs it:

cd hello
atoll run
hello from hello

Change the greeting and run it again; there is no separate build step.

Test it

src/main_test.at came with the project. A file ending in _test.at holds tests — a test "greets" { … } item, with assert_eq saying what it expects — and atoll test runs them:

atoll test
    PASS [   0.001s] src/main_test.at: greets
------------
 Summary [   0.015s] 1 test run: 1 passed, 0 failed
 Slowest: 0.001s src/main_test.at: greets

The everyday commands

Command What it does
atoll run Check, compile and run the project here. Arguments after -- are the program’s.
atoll check Check it and report problems, without running anything.
atoll test Run its tests.
atoll fmt Rewrite its source in the one canonical style.
atoll lint check, and fail on warnings too — for CI.
atoll add <module> Depend on another package.

Tooling has the rest.

Your editor

atoll-lsp is a language server: diagnostics as you type, hover, go to definition, completion and formatting, in any editor with an LSP client. Install it beside atoll:

cargo install --path atoll/code/compiler/rust/crates/atoll-lsp

Then point your editor’s LSP client at the atoll-lsp command for .at files — it speaks LSP on standard input and output and takes no arguments. In Helix, for example, in languages.toml:

[language-server.atoll]
command = "atoll-lsp"

[[language]]
name = "atoll"
scope = "source.atoll"
file-types = ["at"]
roots = ["atoll.toml"]
language-servers = ["atoll"]

atoll-lsp --mcp is the same toolchain for a coding agent: a Model Context Protocol server on standard input and output, for the project in the directory it starts in. Its tools check the project (unsaved text included, passed with the call) and answer the diagnostics as JSON, give the type at a place, show what decorators generate, and run atoll test, build and run. Add it to your agent’s MCP servers as the command atoll-lsp with the argument --mcp.

  • The Tour — the whole language in one page, as a small program grows.
  • Bindings and loops, the first two chapters of the language guide.
  • Projects — packages, dependencies and the lock.

If you are implementing Atoll

Read the compiler pipeline before the individual intermediate representation references. The pipeline explains why each representation exists; the IR chapters define what each stage may assume and must preserve.

Type to search…

↑↓ navigate↵ selectEsc close