Nikaia Toolchain Architecture

How the crates in the Nikaia workspace stack up. The separation they implement is ADR-003: the language and the machinery that compiles it are two programs, and the interface between them is Rust source text.

High-Level Stack

graph TD
    A[User source .nika] -->|Input| B(Crate: nikaia)
    subgraph Frontend
        B -->|Parses| C{AST}
        C -->|Lowers| D[Rust source text]
    end
    D -->|Written out| E[Generated .rs]
    E -->|Invokes| F[System rustc]
    F -->|Produces| G[Binary executable]

    H(Crate: orchestrator) -.->|cache, manifest, cargo| B
    I(Crate: nikaia-std) -.->|linked into| G

Detailed Component Breakdown

1. The frontend and the CLI: crates/nikaia

2. The manager: crates/orchestrator

3. The standard library: crates/nikaia-std

Data Flow Example

  1. Input: let x = 5
  2. Parser: ast::Stmt::Let { name: "x", value: LitInt(5), … }
  3. Emitter: let x = 5; inside the generated fn main, plus the source map entry that points that line back at the .nika one.
  4. rustc: compiles the file to machine code.
This site is open source. Improve this page.