Explicit Memory Management
No garbage collector. Control stack and heap with new, release, and defer. Deterministic, predictable performance.
Mathematical rigor meets practical engineering. Explicit memory, powerful patterns, zero compromise.
enum Option[T] {
Some(T),
None
}
fn find(items: []i32, target: i32) -> Option[i32] {
for let i = 0; i < items.len; i = i + 1 {
if items[i] == target {
return Some(i);
}
}
return None;
}
fn main() -> unit {
let numbers: [5]i32 = [10, 20, 30, 40, 50];
match find(numbers, 30) {
Some(idx) -> println("Found at index"),
None -> println("Not found")
};
return;
}git clone https://github.com/nicclang/nicc.git
cd nicc
cabal buildThen compile and run your first program:
cabal run nicc -- --compile hello.nic
./hello