nca-v0: stdlib-backed low-level primitives
Establish the first practical NCA integration path by allowing paired .nc / .nca files to provide low-level stdlib implementations with explicit machine-level semantics.
This milestone covers the compiler, stdlib, and tests needed for NCA-backed functions such as std/math.wrapping_add, std/math.wrapping_sub, and std/math.wrapping_mul.
The goal is to define a clean semantic boundary:
- ordinary NC arithmetic remains checked and panics on overflow
- handwritten NCA can intentionally use native wrapping / modulo arithmetic
- stdlib code can expose explicit safe APIs for algorithms that require wrapping behavior
- PCG, hashing, checksums, crypto primitives, and bit mixers should use these APIs instead of depending on unchecked NC overflow
Scope:
- add paired-file support for
std/math.ncandstd/math.nca - support
///@ncadeclarations for stdlib functions - bind NCA implementations by module path, symbol name, parameter types, and return type
- implement
wrapping_add,wrapping_sub, andwrapping_mul - ensure normal NC
+,-, and*lower to checked arithmetic separately - add tests for wrapping behavior and overflow panic behavior
- update affected stdlib code such as PCG/random state advancement
This milestone should make NCA useful for real stdlib code without weakening NC’s default safety guarantees.
No due date
0% Completed