nC_PROGRAMMING LANGUAGE

The first program

The repository retains this source in examples/00_hello/hello.n:

nc
use <io:output>;

helloCompacto {
    to main {
        println("Hello, nC public beta");
    }

    fa:
        return true;
}

The import selects the io output service. helloCompacto names the container. to main declares the compact entry point; fa: supplies the container final. Braces delimit the container and execution block.

From the extracted Linux or WSL kit:

bash
./ncc compiler sema hello.n
./ncc compiler emit-ir hello.n

In PowerShell:

powershell
.\ncc.exe compiler sema hello.n
.\ncc.exe compiler emit-ir hello.n

compiler sema checks the program. compiler emit-ir exposes its intermediate representation. Both commands should exit with code 0. IR output describes the program; execution requires emitting and launching a target image as shown in the toolchain setup.

View source on GitHub ↗PDF manual ↓

Search nC