nC_PROGRAMMING LANGUAGE

The machine layer

[@machine] participates in the same typed system. Registers, labels, instructions and terminators carry contracts that must remain coherent through analysis and IR. examples/11_machine/checked_add_overflow_machine.n demonstrates addition followed by an overflow branch.

This route requires Stage0. From the repository root on Linux or WSL, invoke the already-built executable directly. On Windows, use .\target\debug\ncc.exe with the same arguments. These entry points are not implemented by the V81 native kit.

bash
./target/debug/ncc check \
  examples/11_machine/checked_add_overflow_machine.n
./target/debug/ncc emit-ir \
  examples/11_machine/checked_add_overflow_machine.n

Object-contract .nm modules require the machine CLI:

bash
./target/debug/ncc machine emit-ir \
  examples/11_machine/object_elf64.nm

A branch needs a valid destination. A terminator closes an execution path, and the IR must retain that control-flow decision. Accepting an unterminated block where the contract requires termination moves an inconsistency into the backend.

Inspect examples containing halt, privileged registers or ISA-specific instructions before attempting execution. They require a compatible target and execution context. Parser acceptance alone does not establish host executability.

primitive[@] exposes a different material level. Its relationship to machine instructions, memory and linkage must remain explicit. Duplicating semantics across surfaces makes those contracts harder to verify.

View source on GitHub ↗PDF manual ↓

Search nC