Introduction to NouvaLang
NouvaLang is a modern, statically-typed programming language written entirely from scratch in Rust, designed for clean syntax, predictability, and high execution speed.
What is NouvaLang?
NouvaLang bridges the readability and minimalism of high-level scripting languages with the safety, strict typing, and precision required in robust engineering systems.
- Zero Dependencies: Built entirely in pure Rust standard library.
- Predictable Type Safety: Strict static type checking at assignment, parameter binding, and return statements.
- Modern Grammar: Clean blocks with mandatory braces and parentheses-free conditionals.
A Quick Taste of Nouva
Here is how a clean recursive Fibonacci sequence looks in NouvaLang:
// Define a typed recursive function
fun fibonacci(n: int) -> int {
if n <= 1 {
return n;
}
return fibonacci(n - 1) + fibonacci(n - 2);
}
// Compute and output
for i in 0 to 9 {
let result: int = fibonacci(i);
print("fib(" + (i as str) + ") =", result);
}
Architecture Overview
The compiler and execution pipeline follows a clear 3-stage process:
- Lexer (Tokenization): Converts raw source code into structured tokens with full support for literals, comments, and compound symbols.
- Pratt Parser: Parses expressions using precedence climbing, building a resilient Abstract Syntax Tree (AST).
- Tree-Walking Evaluator: Executes the AST directly with enclosed lexical scoping, constant checking, and strict type assertion.