nC_PROGRAMMING LANGUAGE

Places and functions

value >> int <- 0; declares a typed place and initializes its bits. >> separates the name and type; <- writes a value. A declaration without an initializer does not guarantee initialized memory.

nc
counter {
    fn:
        public:
            run() -> bool {
                value >> int <- 0;
                while (value < 3) {
                    value <- value + 1;
                }
                return value == 3;
            }

    ref main ->> run;

    fa:
        return true;
}

fn: groups functions. public: controls visibility, and ref main ->> run; selects the entry point. The name run has no implicit entry-point privilege. Its bool result is produced by the final comparison.

Parameters use declarations such as value >> int. Blocks and if, else and while express control flow. Transformations must preserve the evaluation order defined by the source.

Keep examples small enough to verify their result. Add a condition, function or import only after the preceding program works. When a diagnostic appears, retain the smallest source that reproduces it.

The current parser and fixtures define the accepted compact syntax. Older documents and migration tools may retain historical forms; their presence in the repository does not establish current compiler support.

View source on GitHub ↗PDF manual ↓

Search nC