In a world where new hyped language compilers and runtime std libraries are implemented in 4GB of sources, it's time for a reset.
At the foundation is Nýr, a portable micro-IR (µIR) designed for efficient and flexible code generation across RISC and CISC CPU ISAs. Built on top of Nýr is Nova, a new minimal high-level language that embraces modern programming principles. Together, Nýr and Nova represent a bold step toward a leaner, more elegant future in software development. Nava isn't just a language it's a philosophy: that the complexity of modern systems is not a necessity but a choice. Nava chooses minimalism, portability and readability.
Nova is a modern simplified C++ with a touch of Lua, designed for clarity and modern expression. It uses fn
for function declarations, first class multiple return times and omits parentheses for conditional statements, and optional curly braces for single expression functions, too.
// Single-line comment
/*
Multi-line
comment
*/
fn if else for return
break continue class enum
typeof sizeof switch case
import template try catch
123 // integer
3.14 // float
"hello" // string
'c' // char
true, false // boolean
null // null value
+ - * / % // arithmetic
== != < > <= >= // comparison
&& || ! // logical
& | ^ ~ << >> // bitwise
= += -= *= /= ... // assignment
fn main() {
print("Hello, " + name)
}
curly braces are optional for single expressions for functions, too
fn main()
print("Hello, " + name)
natively supports multiple return values just likr arguments, too
fn int, int test(int x, int y)
return x, y
int v, error = test(x, y)
if x > 0 {
print("Positive")
} else {
print("Negative or zero")
}
for int i = 0; i < 10; ++i {
print(i)
}
for iterators and generators, too
for string s = it.next() {
print(i)
}
Only one way to structure and object-oriented classes.
class Vec2 {
float x,
i32 y,
}
enum Color {
Red,
Green,
Blue,
}
switch color {
case Red:
print("Stop")
case Green:
print("Go")
default:
print("Wait")
}
Nova does not use a pre-processor and will find defines from module exports.
import math
fn main() {
print(math.sqrt(16))
}
Nova will support basic exception handling using throw
and catch
.
fn risky()
throw "Something went wrong"
fn main() {
try
risky()
catch err
print("Error was: " + err)
}
You can catch exceptions using a scoped try
/catch
block. The error object can be a string or structured data depending on the throw.
Nova will eventually support generics using the template
keyword before fn
or class
.
template<T>
fn T identity(T value) {
return value
}
template<T>
class Box {
T value
}
Generics allow type-safe, reusable code without sacrificing readability.