Nitpick Low-Level Hardware & OS Integration
Nitpick is designed for systems-level control. It exposes direct access to hardware and operating system capabilities through explicit, highly-auditable syntactic mechanisms.
1. System Calls
(sys Builtins)
Nitpick categorizes direct syscall invocation into three increasingly permissive tiers, each mapped to different safety guarantees. This allows security auditors to immediately track dangerous behavior.
sys(CONST, args...)- Safe Tier: Allows access to a curated whitelist of ~55 non-destructive syscalls.
- The first argument must be a named constant
representing the syscall
(e.g.
sys(READ, ...)). - Returns a
Result<int64>.
sys!!(CONST, args...)- Full Tier: Allows access to
all ~370+ syscalls on the OS
(e.g.
FORK,EXEC). - The first argument must still be a named constant.
- Returns a
Result<int64>.
- Full Tier: Allows access to
all ~370+ syscalls on the OS
(e.g.
sys!!!(expr, args...)- Raw Tier: Complete escape hatch. The
syscall identifier can be any
int64expression (computed at runtime), rather than a constant. - Returns a bare
int64, completely bypassing theResult<T>safety wrapper. This is heavily flagged during audit.
- Raw Tier: Complete escape hatch. The
syscall identifier can be any
2. Pointers and Memory
Unlike C, where pointers use the * operator
ambiguously (for both multiplication and dereferencing),
Nitpick explicitly separates these operators visually to
prevent parser ambiguity and improve readability.
->: Type Annotation & Field Access.- In a type signature, it means “pointer to”. (e.g.,
int32->meansint32*). - In an expression, it acts like C’s arrow operator (dereference and field access).
- In a type signature, it means “pointer to”. (e.g.,
@: Address Of. Returns the pointer address of a variable (like C’s&).<-: Deep Dereference. Dereferences the entire pointer, extracting the value.
int32:x = 42i32;
int32->:ptr = @x; // Address-of
int32:val = <-ptr; // Full dereference
(Note: In extern blocks defining C-FFI
functions, the traditional * symbol is used for
thin pointers to remain compatible with C headers).
3. Inline Assembly
For bare-metal tuning, Nitpick allows LLVM-mapped inline assembly blocks.
asm!!<T>(arch, code, constraints, args...): Evaluates assembly and maps negative return values to aResult<T>error.asm!!!<T>(arch, code, constraints, args...): Evaluates assembly and returns bareTvalues directly.
(See asm_specs.txt for full assembly
constraints and mapping rules).