code wiki / _hdl_build / nx_lang_export.nx
nx_lang_export.nx
buildroot/runtime/_hdl_build/nx_lang_export.nx
about
nx_lang_export.nx -- LANG-EXPORT-002: the Language-Export HAL emitter (templates-as-DATA).
Generalizes the seed (nx_lang_export_seed): the per-language syntax is now DATA
(knowledge/registry/lang_export_backends.tsv, cols name<TAB>ext<TAB>template). ONE render engine
fills ANY language by substituting @N@ = loop bound, <NL> = newline, <DQ> = double-quote. Add a
language = add a row, NO recompile (epigenetics). The neutral spec = sum_of_squares 1..N; the organ
also computes it natively (the Nishi TRUTH the exports must reproduce -- the wheeler flip: Nishi is
the oracle, gcc/node/python are diverse paths verified against it). license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 9 | const K_MAGIC_16384: i64 = 16384 |
| 10 | const K_MAGIC_8192: i64 = 8192 |
functions
| 12 | func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: puts |
| 13 | func puts(s: *u8) -> i64 { sys_write(1, s, slen(s)); return 0 } |
| 15 | func catn(dst: *u8, off: i64, v: i64) -> i64 |
| 27 | func putn(v: i64) -> i64 { let b: *u8 = sys_mmap(28); let o: i64 = catn(b, 0, v); sys_write(1, b, o); return 0 } |
| 28 | func cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64 = off; var i: i64 = 0; while s[i] != (0 as u8) { dst[o] = s[i]; o = o + 1; i = i + 1 } return o } called by 1: main |
| 30 | func readfile(path: *u8, buf: *u8, cap: i64) -> i64 |
| 39 | func wfile(path: *u8, buf: *u8, n: i64) -> i64 { let fd: i64 = sys_openat_wr(path, 420); if fd < 0 { return 0 - 1 } sys_write(fd, buf, n); sys_close(fd); return 0 } |
| 41 | func native(n: i64) -> i64 { var s: i64 = 0; var i: i64 = 1; while i <= n { s = s + (i * i); i = i + 1 } return s } called by 1: main |
| 44 | func scant(buf: *u8, start: i64, end: i64) -> i64 { var p: i64 = start; var g: i64 = 1; while g == 1 { if p >= end { g = 0 } else { if buf[p] == (9 as u8) { g = 0 } else { p = p + 1 } } } return p } called by 1: main |
| 47 | func render(tpl: *u8, tlen: i64, nval: i64, out: *u8) -> i64 |
| 67 | func main() -> i64 |