Skip to content

Nic

A Systems Programming Language

Mathematical rigor meets practical engineering. Explicit memory, powerful patterns, zero compromise.

🎯

Explicit Memory Management

No garbage collector. Control stack and heap with new, release, and defer. Deterministic, predictable performance.

🧩

Powerful Pattern Matching

Exhaustive checks, guards, view patterns, and pattern synonyms. Destructure any data structure with confidence.

🔬

Strong Type System

Generics with monomorphization, algebraic data types, and Hindley-Milner inference. Catch errors at compile time.

Lazy When You Need It

Strict by default with explicit lazy blocks. Build infinite streams and defer expensive computations.

🏗️

OOP When You Need It

Classes with single inheritance, abstract classes, and virtual methods. Value types and reference types coexist.

🔗

Seamless C FFI

Call C functions directly. Export Nic functions to C. Interoperate with existing systems code.

Quick Example

nic
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;
}

Installation

bash
git clone https://github.com/nicclang/nicc.git
cd nicc
cabal build

Then compile and run your first program:

bash
cabal run nicc -- --compile hello.nic
./hello

Released under the MIT License.