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:
nyra.mod— module manifest (modulename; optionaltls,require,link). Syntax: nyra.mod referencenyra.lock/nyra.sum— dependency lock & checksums (empty until you add packages)main.ny— entry point with a Hello World sample
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)
}fn main() -> void {
let x: i32 = 10
let y: i32 = 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")
}fn greet() {
print("Hello from greet.ny")
}Update main.ny:
import "src/greet.ny"
fn main() {
greet()
}import "src/greet.ny"
fn main() -> void {
greet()
}nyra run .
Next steps
- Beginner track — Lesson 1 — step-by-step from your first program (recommended for new programmers)
- Built-in methods — every builtin with a usage example
- Learn Nyra — step-by-step tutorials with runnable code
- Imports guide — functions, structs, constants across files
- Language syntax — variables, loops,
match - Types & data — structs, enums, arrays
- Toolchain —
test,fmt, release builds - Standard library — every function and builtin
- Language reference — keywords, operators, ownership
- Memory & ownership — NLL, lifetimes, Drop, Send/Sync
- Concurrency — spawn captures and channels