Getting started

Install Nyra, scaffold a project, and run your first program in minutes.

1. Install Nyra

You need clang on your PATH. See Installation for macOS, Linux, and Windows (including WSL).

nyra --version
# nyra 0.0.1

2. Create a project

mkdir myapp && cd myapp
nyrapkg init

This creates:

See NyraPkg → project files for what each file does, and how to add a library by hand in nyra.mod. nyra run . / nyra build . auto-fetch missing require packages (like Cargo).

3. Run the program

From the project root (directory containing main.ny):

nyra run .

Expected output:

hello world
Use nyra run . for projects nyra run main.ny compiles a single file and does not load import dependencies. Multi-file apps must use nyra run . or nyra build .. See Modules.

4. Edit main.ny

fn main() {
    let x = 10
    let y = 20
    print(x + y)
}
nyra run .

5. Build a binary

Binaries are written under target/debug/ or target/release/ (like Rust). Path defaults to . when omitted.

nyra build
# built: ./target/debug/main

nyra build --release
# built: ./target/release/main

./target/release/main

Add target/ to .gitignore. See Toolchain for -o, Wasm, and optimization flags.

6. Type-check without running

nyra check
nyra check main.ny

7. Add another source file

Create src/greet.ny:

fn greet() {
    print("Hello from greet.ny")
}

Update main.ny:

import "src/greet.ny"

fn main() {
    greet()
}
nyra run .

Next steps