code wiki / _hdl_build / nx_shell_bench.nx

nx_shell_bench.nx

buildroot/runtime/_hdl_build/nx_shell_bench.nx

6916 B80 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind benchtopic shell
docsdependenciesstructsconstsfunctions

about

nx_shell_bench.nx -- HONEST measured benchmark: nx_shell vs the shell competition (bash/zsh/fish/PowerShell), grounded on the fetched sh_*.raw, ADVERSARIAL/ASTERISK-disciplined (no wave). The competition is mature + huge; nx_shell is tiny + new. So the exceed is SCOPED to a sovereign minority path, and we ADMIT where we lose. EXCEED (sovereign niche, grounded): 1 ZERO-EXTERNAL-BINARY-DEPS builtins in-process (echo/grep/cd/true/false); a unix shell shells out to GNU coreutils (grep/sed/cat/ls... sh_coreutils.raw) -- nx_shell forks 0 external binaries for them. 2 ATTACK-SURFACE no env-var function-import (the Shellshock vector CVE-2014-6271, sh_shellshock.raw) and no arbitrary eval -> immune to that whole RCE class BY CONSTRUCTION. 3 SOVEREIGN-BUILD nx_cc->nxasm, no libc/gcc, 0 dynamic deps; runs Nishi organs natively (ecosystem). 4 NEVER-BRICK spawns userspace, writes 0 firmware -> brick-safe by construction (cardinal 26). PARITY: exec model (fork/execve/wait) ; pipelines+capture + control flow (; && ||). BEHIND (the asterisk -- the competition WINS here): features/scripting (job-control/history/completion/glob/ arrays/functions/expansion, sh_comparison.raw) ; maturity/ecosystem ; interactivity (line-edit/prompt/complete). *** MINORITY-PATH ASTERISK: bash/zsh/PowerShell are the MAINSTREAM and win DECISIVELY on features/scripting/ ecosystem. nx_shell EXCEEDS only on the sovereign/minimal/security niche. We are NOT a better general shell. *** T1 EXCEED=4 (each a grounded sovereign axis). T2 (teeth) BEHIND>=3 (we ADMIT losses -- no wave). T3 the MINORITY-PATH asterisk is carried. expect_exit: 0 Sovereign: nx_syscalls.

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_shell_bench.nx

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write exceed_row have sys_openat_rd sys_close g_puts ↻ g_pn nxi_out nxi_fd sys_mmap ccz_cat_num sys_write ↻ sys_munmap ck g_puts ↻ sys_mmap ↻ sys_openat_rd ↻ sys_read sys_close ↻ sys_openat_append sys_write ↻ sys_exit

structs

none

consts

20const K_MAGIC_65536: i64 = 65536

functions

22func g_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 3: ckexceed_rowmain calls 1: sys_write
27func g_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
28func ck(name: *u8, c: i64) -> i64 { if c==1 { g_puts(" PASS " as *u8) } else { g_puts(" FAIL " as *u8) } g_puts(name); g_puts("\n" as *u8); return c }
called by 1: main calls 1: g_puts
29func have(path: *u8) -> i64 { let fd: i64=sys_openat_rd(path); if fd<0 { return 0 } sys_close(fd); return 1 }
called by 1: exceed_row calls 2: sys_openat_rdsys_close
31func exceed_row(tag: *u8, src: *u8) -> i64
called by 1: main calls 2: haveg_puts
37func main() -> i64