← All examples

No checks

NO_FUCKING_CHECKS: the fourth tier.

no_checks.zg
# `NO_FUCKING_CHECKS` (owner, 2026-09-27): the fourth tier. Everything `no_check` turns off, and
# what C hands back is trusted too, with no `out_of_range` check on a C enum or range. Goes
# where `no_check` goes, a statement or a block, never a file; listed like `no_check`.
extern.C fn write ['fd': int32, 'buf': ptr[uint8], 'len': uint64] -> int64;
MAIN {
    let 'msg' := "hello";
    NO_FUCKING_CHECKS let 'n' := write[1, lend 'msg', str.bytes[lend 'msg']];
    NO_FUCKING_CHECKS {
        let 'a': int32 = 10;
        let 'b': int32 = 2;
        let 'q' := 'a' div.floor 'b';
        std::print.useful[newln, 'q', newln];
    }
}
Output
hello
5