code wiki / (root) / _primes_sieve.nx

_primes_sieve.nx

buildroot/runtime/_primes_sieve.nx

2523 B75 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic primes
docsdependenciesstructsconstsfunctions

about

_primes_sieve.nx -- Sieve of Eratosthenes, NishiLang. Implements the standard "drag race" benchmark from PlummersSoftwareLLC/Primes (Dave's Garage / Dave Plummer): count primes <= 1,000,000. Per Dave's rules: report number of complete passes in a 5-second window. We use a NORMAL byte sieve (1 byte per odd number) -- the "PrimeSieve" base impl Dave compares against. Some entries optimize with bit-packing + wheel factorization; we keep this implementation algorithmically simple to match the reference. We don't have wall-clock in NishiLang, so this version runs a SINGLE pass; the harness shell script wraps with time/loop logic to report passes/sec.

dependencies 1 imports · 0 importers

syscalls.nx _primes_sieve.nx

imports: syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main run_single_pass

structs

none

consts

19const SIEVE_SIZE: i64 = 1000000

functions

21func run_single_pass() -> i64
called by 1: main
70func main() -> i64
calls 1: run_single_pass