code wiki / _hdl_build / nx_shell_bench.nx
nx_shell_bench.nx
buildroot/runtime/_hdl_build/nx_shell_bench.nx
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
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
structs
| none |
consts
| 20 | const K_MAGIC_65536: i64 = 65536 |
functions
| 22 | func 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 } |
| 27 | func g_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 28 | func 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 } |
| 29 | func have(path: *u8) -> i64 { let fd: i64=sys_openat_rd(path); if fd<0 { return 0 } sys_close(fd); return 1 } |
| 31 | func exceed_row(tag: *u8, src: *u8) -> i64 |
| 37 | func main() -> i64 |