Whether you are a systems programmer coming from C++/Rust or an application developer familiar with TypeScript and Python, this tutorial walks you through everything you need to build and run your first Nyx application.
1. Installing the Nyx Compiler Toolchain
Precompiled binaries are available for Windows (x64), Linux (x86_64, ARM64), and macOS:
# Check Nyx compiler version
$ nyx --version
Nyx Sovereign Compiler v0.22.0 (LLVM 18.1.8 Target x86_64-pc-linux-gnu)
# Initialize a new Nyx project
$ nyx new my_app
$ cd my_app
2. Core Syntax Fundamentals
Nyx combines expressive type inference with optional explicit types:
// Immutable by default, mutable with 'mut'
let service_name: string = "PaymentProcessor"
let mut transaction_count: u64 = 0
// Pattern Matching & Algebraic Enums
enum Result<T, E> {
Ok(T),
Err(E)
}
fn process_payment(amount: f64) -> Result<string, string> {
if amount <= 0.0 {
return Result.Err("Invalid transaction amount")
}
return Result.Ok("Transaction Successful: tx_984271")
}
Try Nyx in Your Browser
You can write, run, and experiment with Nyx code without installing anything locally by visiting the Nyx Interactive Academy.
- Simple CLI toolchain: `nyx build`, `nyx run`, and `nyx test`|Expressive syntax inspired by TypeScript and Rust with zero GC latency|Interactive Academy provides instant in-browser experimentation
No comments yet. Be the first to share your thoughts!